mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-08-01 08:24:29 +02:00
changed default for return_list in api.path
This commit is contained in:
parent
1ec4e13eb8
commit
f489259908
2 changed files with 13 additions and 13 deletions
|
@ -167,7 +167,7 @@ class MikrotikAPI:
|
|||
# ---------------------------
|
||||
# path
|
||||
# ---------------------------
|
||||
def path(self, path, return_list=False) -> Optional(list):
|
||||
def path(self, path, return_list=True) -> Optional(list):
|
||||
"""Retrieve data from Mikrotik API."""
|
||||
"""Returns generator object, unless return_list passed as True"""
|
||||
if not self._connected or not self._connection:
|
||||
|
@ -251,7 +251,7 @@ class MikrotikAPI:
|
|||
if not self.connect():
|
||||
return False
|
||||
|
||||
response = self.path(path)
|
||||
response = self.path(path, return_list=False)
|
||||
if response is None:
|
||||
return False
|
||||
|
||||
|
@ -328,7 +328,7 @@ class MikrotikAPI:
|
|||
if not self.connect():
|
||||
return False
|
||||
|
||||
response = self.path("/system/script")
|
||||
response = self.path("/system/script", return_list=False)
|
||||
if response is None:
|
||||
return False
|
||||
|
||||
|
@ -404,7 +404,7 @@ class MikrotikAPI:
|
|||
if not self.connect():
|
||||
return None
|
||||
|
||||
response = self.path("/interface")
|
||||
response = self.path("/interface", return_list=False)
|
||||
if response is None:
|
||||
return None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue