mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-19 18:25:26 +02:00
force check for firmware update, fixes #208
This commit is contained in:
parent
2c61ba596a
commit
bd56487f42
2 changed files with 20 additions and 16 deletions
|
@ -319,6 +319,7 @@ class MikrotikAPI:
|
|||
def execute(self, path, command, param, value) -> bool:
|
||||
"""Execute a command"""
|
||||
entry_found = None
|
||||
params = {}
|
||||
|
||||
if not self.connection_check():
|
||||
return False
|
||||
|
@ -327,26 +328,28 @@ class MikrotikAPI:
|
|||
if response is None:
|
||||
return False
|
||||
|
||||
for tmp in response:
|
||||
if param not in tmp:
|
||||
continue
|
||||
if param:
|
||||
for tmp in response:
|
||||
if param not in tmp:
|
||||
continue
|
||||
|
||||
if tmp[param] != value:
|
||||
continue
|
||||
if tmp[param] != value:
|
||||
continue
|
||||
|
||||
entry_found = tmp[".id"]
|
||||
entry_found = tmp[".id"]
|
||||
|
||||
if not entry_found:
|
||||
_LOGGER.error(
|
||||
"Mikrotik %s Execute %s parameter %s with value %s not found",
|
||||
self._host,
|
||||
command,
|
||||
param,
|
||||
value,
|
||||
)
|
||||
return True
|
||||
if not entry_found:
|
||||
_LOGGER.error(
|
||||
"Mikrotik %s Execute %s parameter %s with value %s not found",
|
||||
self._host,
|
||||
command,
|
||||
param,
|
||||
value,
|
||||
)
|
||||
return True
|
||||
|
||||
params = {".id": entry_found}
|
||||
|
||||
params = {".id": entry_found}
|
||||
self.lock.acquire()
|
||||
try:
|
||||
tuple(response(command, **params))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue