diff --git a/homeassistant/components/tuya/__init__.py b/homeassistant/components/tuya/__init__.py index d67ecafa7e9..7018b1124fb 100644 --- a/homeassistant/components/tuya/__init__.py +++ b/homeassistant/components/tuya/__init__.py @@ -17,6 +17,7 @@ from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import ConfigEntryAuthFailed from homeassistant.helpers import device_registry as dr from homeassistant.helpers.dispatcher import dispatcher_send +from homeassistant.xternal_tuya_quirks import register_tuya_quirks from .const import ( CONF_APP_TYPE, @@ -31,7 +32,6 @@ from .const import ( TUYA_DISCOVERY_NEW, TUYA_HA_SIGNAL_UPDATE_ENTITY, ) -from .quirks import register_tuya_quirks # Suppress logs from the library, it logs unneeded on error logging.getLogger("tuya_sharing").setLevel(logging.CRITICAL) diff --git a/homeassistant/components/tuya/cover.py b/homeassistant/components/tuya/cover.py index 06db6e9fa25..523222cab57 100644 --- a/homeassistant/components/tuya/cover.py +++ b/homeassistant/components/tuya/cover.py @@ -18,12 +18,16 @@ from homeassistant.components.cover import ( from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback +from homeassistant.xternal_tuya_quirks import ( + TUYA_QUIRKS_REGISTRY, + TuyaCoverDefinition, + parse_enum, +) from . import TuyaConfigEntry from .const import TUYA_DISCOVERY_NEW, DeviceCategory, DPCode, DPType from .entity import TuyaEntity from .models import EnumTypeData, IntegerTypeData -from .quirks import TUYA_QUIRKS_REGISTRY, TuyaCoverDefinition, parse_enum from .util import get_dpcode diff --git a/homeassistant/components/tuya/select.py b/homeassistant/components/tuya/select.py index dff4812cbed..3517f0cb7d7 100644 --- a/homeassistant/components/tuya/select.py +++ b/homeassistant/components/tuya/select.py @@ -9,11 +9,15 @@ from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback +from homeassistant.xternal_tuya_quirks import ( + TUYA_QUIRKS_REGISTRY, + TuyaSelectDefinition, + parse_enum, +) from . import TuyaConfigEntry from .const import TUYA_DISCOVERY_NEW, DeviceCategory, DPCode, DPType from .entity import TuyaEntity -from .quirks import TUYA_QUIRKS_REGISTRY, TuyaSelectDefinition, parse_enum # All descriptions can be found here. Mostly the Enum data types in the # default instructions set of each category end up being a select. diff --git a/homeassistant/components/tuya/sensor.py b/homeassistant/components/tuya/sensor.py index 55e9ff4f2a7..ceebd74a31b 100644 --- a/homeassistant/components/tuya/sensor.py +++ b/homeassistant/components/tuya/sensor.py @@ -30,6 +30,11 @@ from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.helpers.typing import StateType +from homeassistant.xternal_tuya_quirks import ( + TUYA_QUIRKS_REGISTRY, + TuyaSensorDefinition, + parse_enum, +) from . import TuyaConfigEntry from .const import ( @@ -44,7 +49,6 @@ from .const import ( ) from .entity import TuyaEntity from .models import ComplexValue, ElectricityValue, EnumTypeData, IntegerTypeData -from .quirks import TUYA_QUIRKS_REGISTRY, TuyaSensorDefinition, parse_enum from .util import get_dptype _WIND_DIRECTIONS = { diff --git a/homeassistant/components/tuya/quirks/__init__.py b/homeassistant/xternal_tuya_quirks/__init__.py similarity index 100% rename from homeassistant/components/tuya/quirks/__init__.py rename to homeassistant/xternal_tuya_quirks/__init__.py diff --git a/homeassistant/components/tuya/quirks/device_quirk.py b/homeassistant/xternal_tuya_quirks/device_quirk.py similarity index 100% rename from homeassistant/components/tuya/quirks/device_quirk.py rename to homeassistant/xternal_tuya_quirks/device_quirk.py diff --git a/homeassistant/components/tuya/quirks/device_quirks/__init__.py b/homeassistant/xternal_tuya_quirks/device_quirks/__init__.py similarity index 100% rename from homeassistant/components/tuya/quirks/device_quirks/__init__.py rename to homeassistant/xternal_tuya_quirks/device_quirks/__init__.py diff --git a/homeassistant/components/tuya/quirks/device_quirks/cl.py b/homeassistant/xternal_tuya_quirks/device_quirks/cl.py similarity index 93% rename from homeassistant/components/tuya/quirks/device_quirks/cl.py rename to homeassistant/xternal_tuya_quirks/device_quirks/cl.py index 238ec77a5a4..5316113aa54 100644 --- a/homeassistant/components/tuya/quirks/device_quirks/cl.py +++ b/homeassistant/xternal_tuya_quirks/device_quirks/cl.py @@ -2,9 +2,9 @@ from __future__ import annotations -from .. import TUYA_QUIRKS_REGISTRY -from ..device_quirk import TuyaDeviceQuirk -from ..homeassistant import TuyaCoverDeviceClass, TuyaEntityCategory +from .. import TUYA_QUIRKS_REGISTRY # noqa: TID252 +from ..device_quirk import TuyaDeviceQuirk # noqa: TID252 +from ..homeassistant import TuyaCoverDeviceClass, TuyaEntityCategory # noqa: TID252 ( # This model has percent_state and percent_control but percent_state never diff --git a/homeassistant/components/tuya/quirks/homeassistant.py b/homeassistant/xternal_tuya_quirks/homeassistant.py similarity index 100% rename from homeassistant/components/tuya/quirks/homeassistant.py rename to homeassistant/xternal_tuya_quirks/homeassistant.py diff --git a/homeassistant/components/tuya/quirks/registry.py b/homeassistant/xternal_tuya_quirks/registry.py similarity index 100% rename from homeassistant/components/tuya/quirks/registry.py rename to homeassistant/xternal_tuya_quirks/registry.py