Fix device re-connect when API connection lost (#25842)

This commit is contained in:
Robert Dunmire III 2019-08-10 07:53:20 -04:00 committed by Martin Hjelmare
parent 9e6732e530
commit 2e4905981e

View File

@ -172,7 +172,8 @@ class MikrotikClient:
def command(self, cmd, params=None):
"""Retrieve data from Mikrotik API."""
if not self._connected or not self._client:
return None
if not self.connect_to_device():
return None
try:
if params:
response = self._client(cmd=cmd, **params)