mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-24 17:58:47 +02:00
Add ability to return list results of API call instead of generator. On generator return do not call iterate over object, removes redundant calls to API. Update calls to api.path with new input param. Fix logging in helper object.
This commit is contained in:
parent
aaf9f6c566
commit
1a46da5aae
3 changed files with 41 additions and 41 deletions
|
@ -57,6 +57,8 @@ def parse_api(
|
|||
data = fill_defaults(data, vals)
|
||||
return data
|
||||
|
||||
_LOGGER.debug("Processing source %s", source)
|
||||
|
||||
keymap = generate_keymap(data, key_search)
|
||||
for entry in source:
|
||||
if only and not matches_only(entry, only):
|
||||
|
@ -74,7 +76,7 @@ def parse_api(
|
|||
if uid not in data:
|
||||
data[uid] = {}
|
||||
|
||||
_LOGGER.debug("Processing entry %s, entry %s", source, entry)
|
||||
_LOGGER.debug("Processing entry %s", entry)
|
||||
if vals:
|
||||
data = fill_vals(data, entry, uid, vals)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue