Skip to content

Commit

Permalink
Merge pull request #536 from cptshrk108/config_flow_config_entry_init
Browse files Browse the repository at this point in the history
Ajout version check pour config_entry init dans config_flow
  • Loading branch information
ic-dev21 authored Jan 9, 2025
2 parents bbbd78e + c29dede commit 9b42f6c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions custom_components/hilo/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import logging
from typing import Any

from awesomeversion import AwesomeVersion
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_SCAN_INTERVAL
from homeassistant.const import CONF_SCAN_INTERVAL, __version__ as HAVERSION
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers import config_validation as cv, selector
Expand Down Expand Up @@ -152,8 +153,11 @@ class HiloOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle a Hilo options flow."""

def __init__(self, config_entry: ConfigEntry) -> None:
"""Initialize."""
self._config_entry = config_entry
"""Initialize"""
if AwesomeVersion(HAVERSION) < "2024.11.99":
self.config_entry = config_entry
else:
self._config_entry = config_entry

async def async_step_init(
self, user_input: dict[str, Any] | None = None
Expand Down

0 comments on commit 9b42f6c

Please sign in to comment.