diff --git a/custom_components/xiaomi_miot/core/const.py b/custom_components/xiaomi_miot/core/const.py index 195876cbe..91c06268a 100644 --- a/custom_components/xiaomi_miot/core/const.py +++ b/custom_components/xiaomi_miot/core/const.py @@ -4,7 +4,6 @@ from .device_customizes import DEVICE_CUSTOMIZES # noqa from .miot_local_devices import MIOT_LOCAL_MODELS # noqa from .translation_languages import TRANSLATION_LANGUAGES # noqa -from homeassistant.util.json import JsonObjectType DOMAIN = 'xiaomi_miot' DEFAULT_NAME = 'Xiaomi Miot' @@ -84,6 +83,12 @@ class EntityCategory(Enum): except (ModuleNotFoundError, ImportError): DOMAIN_TEXT = None +try: + # hass 2023.3 + from homeassistant.util.json import JsonObjectType +except (ModuleNotFoundError, ImportError): + JsonObjectType = dict + try: # hass 2023.7 from homeassistant.core import ServiceResponse, SupportsResponse