Use OptionsFlowWithReload in roku (#149172)

This commit is contained in:
G Johansson 2025-07-21 15:40:30 +02:00 committed by GitHub
parent f3db3ba3c8
commit 80b96b0007
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 9 deletions

View File

@ -25,16 +25,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: RokuConfigEntry) -> bool
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
entry.async_on_unload(entry.add_update_listener(async_reload_entry))
return True
async def async_unload_entry(hass: HomeAssistant, entry: RokuConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
async def async_reload_entry(hass: HomeAssistant, entry: RokuConfigEntry) -> None:
"""Reload the config entry when it changed."""
await hass.config_entries.async_reload(entry.entry_id)

View File

@ -13,7 +13,7 @@ from homeassistant.config_entries import (
SOURCE_RECONFIGURE,
ConfigFlow,
ConfigFlowResult,
OptionsFlow,
OptionsFlowWithReload,
)
from homeassistant.const import CONF_HOST, CONF_NAME
from homeassistant.core import HomeAssistant, callback
@ -202,7 +202,7 @@ class RokuConfigFlow(ConfigFlow, domain=DOMAIN):
return RokuOptionsFlowHandler()
class RokuOptionsFlowHandler(OptionsFlow):
class RokuOptionsFlowHandler(OptionsFlowWithReload):
"""Handle Roku options."""
async def async_step_init(