Skip to content

Commit

Permalink
Merge pull request #164 from gjohansson-ST/reload-on-options-change
Browse files Browse the repository at this point in the history
Reload on options change
  • Loading branch information
gjohansson-ST authored Nov 4, 2023
2 parents d1e26b5 + ce486fa commit ff2240a
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 ff2240a

Please sign in to comment.