mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix device re-connect when API connection lost (#25842)
This commit is contained in:
parent
9e6732e530
commit
2e4905981e
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user