Skip to content

Commit

Permalink
simplify config
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Oct 28, 2019
1 parent a672923 commit d50e9b9
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions custom_components/hacs/hacsbase/configuration.py
Expand Up @@ -43,16 +43,10 @@ def from_dict(configuration: dict, options: dict):
if not configuration:
raise HacsUserScrewupException("Configuration is not valid.")

return Configuration(
config=configuration,
options=options,
appdaemon=configuration.get("appdaemon", False),
python_script=configuration.get("python_script", False),
sidepanel_icon=configuration.get("sidepanel_icon", "mdi:alpha-c-box"),
sidepanel_title=configuration.get("sidepanel_title", "Community"),
theme=configuration.get("theme", False),
token=configuration.get("token"),
country=options.get("country", "ALL"),
experimental=options.get("experimental", False),
release_limit=options.get("release_limit", 5),
)
config = Configuration()

for conf_type in [configuration, options]:
for key in conf_type:
setattr(config, key, conf_type[key])

return config

0 comments on commit d50e9b9

Please sign in to comment.