mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-24 17:58:47 +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()
|
||||
if not entry_found:
|
||||
error = f'Parameter "{param}" with value "{value}" not found'
|
||||
raise ApiEntryNotFound(error)
|
||||
_LOGGER.error("Mikrotik %s Update parameter %s with value %s not found", self._host, param, value)
|
||||
|
||||
return True
|
||||
|
||||
|
@ -343,8 +342,7 @@ class MikrotikAPI:
|
|||
|
||||
self.lock.release()
|
||||
if not entry_found:
|
||||
error = f'Script "{name}" not found'
|
||||
raise ApiEntryNotFound(error)
|
||||
_LOGGER.error("Mikrotik %s Script %s not found", self._host, name)
|
||||
|
||||
return True
|
||||
|
||||
|
@ -461,7 +459,7 @@ class MikrotikAPI:
|
|||
self.lock.release()
|
||||
|
||||
for tmp in ping:
|
||||
if tmp["received"] > 0:
|
||||
if "received" in tmp and tmp["received"] > 0:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue