Skip to content

Commit

Permalink
Reload on options change
Browse files Browse the repository at this point in the history
  • Loading branch information
gjohansson-ST committed Nov 4, 2023
1 parent d1e26b5 commit ce486fa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions custom_components/sector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

async def async_update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Update when config_entry options update."""
controller: DataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]["coordinator"]
controller.update_interval = timedelta(
seconds=entry.options.get(UPDATE_INTERVAL, 60)
)
await hass.config_entries.async_reload(entry.entry_id)


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
Expand Down

0 comments on commit ce486fa

Please sign in to comment.