Skip to content

Commit

Permalink
fix config load (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolwi committed Aug 25, 2024
1 parent 693aa68 commit a854ae0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/ecoflow_cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry):
title = "Home_api"
new_data[CONF_ACCESS_KEY] = config_entry.data[CONF_ACCESS_KEY]
new_data[CONF_SECRET_KEY] = config_entry.data[CONF_SECRET_KEY]
new_data[CONF_LOAD_ALL_DEVICES] = False
new_data[CONF_GROUP] = title

hass.config_entries.async_update_entry(config_entry,
Expand Down Expand Up @@ -193,10 +194,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
devices_list: dict[str, DeviceData] = {}
devices_options: dict[str, DeviceOptions] = {}

if not entry.data[CONF_LOAD_ALL_DEVICES]:
if CONF_LOAD_ALL_DEVICES not in entry.data or not entry.data[CONF_LOAD_ALL_DEVICES]:
devices_list.update(extract_devices(entry))
devices_options.update(extract_options(entry))

else:
try:
from .devices.registry import device_by_product
Expand Down

0 comments on commit a854ae0

Please sign in to comment.