mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-01 04:54:29 +02:00
simplified api path call
This commit is contained in:
parent
df9f551b96
commit
fc74a2cd56
1 changed files with 2 additions and 4 deletions
|
@ -146,8 +146,7 @@ class MikrotikAPI:
|
|||
self.lock.acquire()
|
||||
try:
|
||||
response = self._connection.path(path)
|
||||
tmp = tuple(response)
|
||||
_LOGGER.debug("API response (%s): %s", path, tmp)
|
||||
_LOGGER.debug("API response (%s): %s", path, response)
|
||||
except librouteros_custom.exceptions.ConnectionClosed:
|
||||
self.lock.release()
|
||||
_LOGGER.error("Mikrotik %s connection closed", self._host)
|
||||
|
@ -173,9 +172,8 @@ class MikrotikAPI:
|
|||
_LOGGER.error("Mikrotik %s error while path %s", self._host, "unknown")
|
||||
self.disconnect()
|
||||
return None
|
||||
else:
|
||||
self.lock.release()
|
||||
|
||||
self.lock.release()
|
||||
return response if response else None
|
||||
|
||||
# ---------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue