Skip to content

Commit

Permalink
🔧 fix deprecated constants (#1877)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Sep 29, 2024
1 parent a3c8839 commit e83a41d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion custom_components/xiaomi_miot/core/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from enum import Enum, StrEnum
from enum import Enum
from typing import Union

from .device_customizes import DEVICE_CUSTOMIZES # noqa
Expand Down Expand Up @@ -44,6 +44,13 @@
'us': 'United States',
}

try:
# python 3.11
from enum import StrEnum
except (ModuleNotFoundError, ImportError):
class StrEnum(str, Enum):
pass

try:
# hass 2020.12.2
from homeassistant.components.number import DOMAIN as DOMAIN_NUMBER
Expand Down

0 comments on commit e83a41d

Please sign in to comment.