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:
Ivan Pavlina 2020-04-04 17:51:35 +02:00
parent aaf9f6c566
commit 1a46da5aae
3 changed files with 41 additions and 41 deletions

View file

@ -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)