Skip to content

Commit

Permalink
issue #713 - config_entry is deprecated (#738)
Browse files Browse the repository at this point in the history
Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
  • Loading branch information
jmcollin78 and Jean-Marc Collin authored Dec 22, 2024
1 parent 8559dd1 commit 6e5e304
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions custom_components/versatile_thermostat/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ async def async_step_finalize(self, _):
)


class VersatileThermostatConfigFlow(
class VersatileThermostatConfigFlow( # pylint: disable=abstract-method
VersatileThermostatBaseConfigFlow, HAConfigFlow, domain=DOMAIN
):
"""Handle a config flow for Versatile Thermostat."""
Expand All @@ -929,6 +929,8 @@ def __init__(self) -> None:
@callback
def async_get_options_flow(config_entry: ConfigEntry):
"""Get options flow for this handler"""
# #713 doesn't work as explained here:https://developers.home-assistant.io/blog/2024/11/12/options-flow
# should be - return VersatileThermostatOptionsFlowHandler() but hass is not initialized
return VersatileThermostatOptionsFlowHandler(config_entry)

async def async_step_finalize(self, _):
Expand All @@ -947,8 +949,12 @@ class VersatileThermostatOptionsFlowHandler(

def __init__(self, config_entry: ConfigEntry) -> None:
"""Initialize options flow."""

self._conf_app_id: str | None = None

super().__init__(config_entry.data.copy())
self.config_entry = config_entry
# #713
# self.config_entry = config_entry
_LOGGER.debug(
"CTOR VersatileThermostatOptionsFlowHandler info: %s, entry_id: %s",
self._infos,
Expand Down

0 comments on commit 6e5e304

Please sign in to comment.