mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-04 22:44:32 +02:00
replaced raise with logger error message for api queries
This commit is contained in:
parent
92df7d9c6f
commit
715fcc74ea
1 changed files with 3 additions and 5 deletions
|
@ -289,8 +289,7 @@ class MikrotikAPI:
|
||||||
|
|
||||||
self.lock.release()
|
self.lock.release()
|
||||||
if not entry_found:
|
if not entry_found:
|
||||||
error = f'Parameter "{param}" with value "{value}" not found'
|
_LOGGER.error("Mikrotik %s Update parameter %s with value %s not found", self._host, param, value)
|
||||||
raise ApiEntryNotFound(error)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -343,8 +342,7 @@ class MikrotikAPI:
|
||||||
|
|
||||||
self.lock.release()
|
self.lock.release()
|
||||||
if not entry_found:
|
if not entry_found:
|
||||||
error = f'Script "{name}" not found'
|
_LOGGER.error("Mikrotik %s Script %s not found", self._host, name)
|
||||||
raise ApiEntryNotFound(error)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -461,7 +459,7 @@ class MikrotikAPI:
|
||||||
self.lock.release()
|
self.lock.release()
|
||||||
|
|
||||||
for tmp in ping:
|
for tmp in ping:
|
||||||
if tmp["received"] > 0:
|
if "received" in tmp and tmp["received"] > 0:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue