improved debug messages

fixed TrafficSensor unique id
This commit is contained in:
tomaae 2019-12-10 22:29:35 +01:00
parent f1a239f118
commit 81f25765f7
4 changed files with 11 additions and 5 deletions

View file

@ -122,7 +122,7 @@ class MikrotikAPI:
try:
response = self._connection.path(path)
tuple(response)
_LOGGER.debug("API response ({}): {}".format(path, tuple(response)))
except librouteros_custom.exceptions.ConnectionClosed:
_LOGGER.error("Mikrotik %s connection closed", self._host)
self._connected = False
@ -251,6 +251,7 @@ class MikrotikAPI:
args = {'interface': interfaces, 'once': True}
try:
traffic = response('monitor-traffic', **args)
_LOGGER.debug("API response ({}): {}".format("/interface/monitor-traffic", tuple(response)))
except librouteros_custom.exceptions.ConnectionClosed:
_LOGGER.error("Mikrotik %s connection closed", self._host)
self._connected = False