Use OptionsFlowWithReload in jewish_calendar (#149121)

This commit is contained in:
G Johansson 2025-07-20 13:05:39 +02:00 committed by GitHub
parent 0c858de1af
commit 0d42b24467
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 9 deletions

View File

@ -79,13 +79,6 @@ async def async_setup_entry(
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS) await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
async def update_listener(
hass: HomeAssistant, config_entry: JewishCalendarConfigEntry
) -> None:
# Trigger update of states for all platforms
await hass.config_entries.async_reload(config_entry.entry_id)
config_entry.async_on_unload(config_entry.add_update_listener(update_listener))
return True return True

View File

@ -9,7 +9,11 @@ import zoneinfo
from hdate.translator import Language from hdate.translator import Language
import voluptuous as vol import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult, OptionsFlow from homeassistant.config_entries import (
ConfigFlow,
ConfigFlowResult,
OptionsFlowWithReload,
)
from homeassistant.const import ( from homeassistant.const import (
CONF_ELEVATION, CONF_ELEVATION,
CONF_LANGUAGE, CONF_LANGUAGE,
@ -124,7 +128,7 @@ class JewishCalendarConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_update_reload_and_abort(reconfigure_entry, data=user_input) return self.async_update_reload_and_abort(reconfigure_entry, data=user_input)
class JewishCalendarOptionsFlowHandler(OptionsFlow): class JewishCalendarOptionsFlowHandler(OptionsFlowWithReload):
"""Handle Jewish Calendar options.""" """Handle Jewish Calendar options."""
async def async_step_init( async def async_step_init(