Skip to content

Commit

Permalink
🔧 fix for config flow (#2010)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Dec 12, 2024
1 parent 397f870 commit 47ce8eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions custom_components/xiaomi_miot/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
in_china,
async_analytics_track_event,
)
from .core.const import SUPPORTED_DOMAINS, CLOUD_SERVERS, CONF_XIAOMI_CLOUD
from .core.const import SUPPORTED_DOMAINS, CLOUD_SERVERS, CONF_XIAOMI_CLOUD, HA_VERSION
from .core.miot_spec import MiotSpec
from .core.xiaomi_cloud import (
MiotCloud,
Expand Down Expand Up @@ -585,8 +585,7 @@ async def async_step_customizing(self, user_input=None):

class OptionsFlowHandler(config_entries.OptionsFlow, BaseFlowHandler):
def __init__(self, config_entry: config_entries.ConfigEntry):
if not hasattr(self, 'config_entry'):
# hass v2024.12+
if HA_VERSION >= '2024.12':
self.config_entry = config_entry

@property
Expand Down
3 changes: 3 additions & 0 deletions custom_components/xiaomi_miot/core/const.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from enum import Enum
from typing import Union

from homeassistant.const import __version__ as HAVERSION # noqa
from awesomeversion import AwesomeVersion
from .device_customizes import DEVICE_CUSTOMIZES, GLOBAL_CONVERTERS # noqa
from .miot_local_devices import MIOT_LOCAL_MODELS # noqa
from .translation_languages import TRANSLATION_LANGUAGES # noqa

DOMAIN = 'xiaomi_miot'
DEFAULT_NAME = 'Xiaomi Miot'
HA_VERSION = AwesomeVersion(HAVERSION)

CONF_MODEL = 'model'
CONF_XIAOMI_CLOUD = 'xiaomi_cloud'
Expand Down

0 comments on commit 47ce8eb

Please sign in to comment.