Skip to content

Commit

Permalink
Ajout version check pour config_entry init dans config_flow depuis qu…
Browse files Browse the repository at this point in the history
…e c'est no longer allowed dans HA > 24.11.99
  • Loading branch information
cptshrk108 committed Jan 8, 2025
1 parent bbbd78e commit 4347fad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 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,9 @@ 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

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

0 comments on commit 4347fad

Please sign in to comment.