Skip to content

Commit

Permalink
Try setting default values when reading config
Browse files Browse the repository at this point in the history
  • Loading branch information
magico13 committed Feb 1, 2021
1 parent 0a24141 commit b9ae82d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/emporia_vue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):

hass.data[DOMAIN][entry.entry_id] = {
VUE_DATA: vue,
ENABLE_1S: entry_data[ENABLE_1S],
ENABLE_1M: entry_data[ENABLE_1M],
ENABLE_1D: entry_data[ENABLE_1D],
ENABLE_1MON: entry_data[ENABLE_1MON]
ENABLE_1S: False if ENABLE_1S not in entry_data else entry_data[ENABLE_1S],
ENABLE_1M: True if ENABLE_1M not in entry_data[ENABLE_1M] else entry_data[ENABLE_1M],
ENABLE_1D: True if ENABLE_1D not in entry_data else entry_data[ENABLE_1D],
ENABLE_1MON: True if ENABLE_1MON not in entry_data else entry_data[ENABLE_1MON]
}

for component in PLATFORMS:
Expand Down

0 comments on commit b9ae82d

Please sign in to comment.