diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 158494946028..b94530e432b0 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -157,13 +157,16 @@ class DeviceCategory(StrEnum): https://developer.tuya.com/en/docs/iot/categorycwwsq?id=Kaiuz2b6vydld """ CWYSJ = "cwysj" - """Pet fountain""" + """Pet fountain + + https://developer.tuya.com/en/docs/iot/categorycwysj?id=Kaiuz2dfro0nd + """ CZ = "cz" """Socket""" DBL = "dbl" """Electric fireplace - https://developer.tuya.com/en/docs/iot/f?id=Kacpeobojffop + https://developer.tuya.com/en/docs/iot/electric-fireplace?id=Kaiuz2hz4iyp6 """ DC = "dc" """String lights @@ -188,7 +191,10 @@ class DeviceCategory(StrEnum): https://developer.tuya.com/en/docs/iot/categorydj?id=Kaiuyzy3eheyy """ DLQ = "dlq" - """Circuit breaker""" + """Circuit breaker + + https://developer.tuya.com/en/docs/iot/dlq?id=Kb0kidk9enyh8 + """ DR = "dr" """Electric blanket @@ -212,7 +218,10 @@ class DeviceCategory(StrEnum): https://developer.tuya.com/en/docs/iot/ambient-light?id=Kaiuz06amhe6g """ GGQ = "ggq" - """Irrigator""" + """Irrigator + + https://developer.tuya.com/en/docs/iot/categoryggq?id=Kaiuz1qib7z0k + """ GYD = "gyd" """Motion sensor light @@ -307,7 +316,10 @@ class DeviceCategory(StrEnum): MS_CATEGORY = "ms_category" """Lock accessories""" MSP = "msp" - """Cat toilet""" + """Cat toilet + + https://developer.tuya.com/en/docs/iot/s?id=Kakg3srr4ora7 + """ MZJ = "mzj" """Sous vide cooker @@ -428,7 +440,10 @@ class DeviceCategory(StrEnum): XFJ = "xfj" """Ventilation system""" XXJ = "xxj" - """Diffuser""" + """Diffuser + + https://developer.tuya.com/en/docs/iot/categoryxxj?id=Kaiuz1f9mo6bl + """ XY = "xy" """Washing machine""" YB = "yb" @@ -456,7 +471,10 @@ class DeviceCategory(StrEnum): https://developer.tuya.com/en/docs/iot/categoryzd?id=Kaiuz3a5vrzno """ ZNDB = "zndb" - """Smart electricity meter""" + """Smart electricity meter + + https://developer.tuya.com/en/docs/iot/smart-meter?id=Kaiuz4gv6ack7 + """ ZNFH = "znfh" """Bento box""" ZNSB = "znsb" @@ -465,6 +483,8 @@ class DeviceCategory(StrEnum): """Smart pill box""" # Undocumented + AQCZ = "aqcz" + """Single Phase power meter (undocumented)""" BZYD = "bzyd" """White noise machine (undocumented)""" CWJWQ = "cwjwq" @@ -486,6 +506,11 @@ class DeviceCategory(StrEnum): """ FSKG = "fskg" """Fan wall switch (undocumented)""" + HJJCY = "hjjcy" + """Air Quality Monitor + + https://developer.tuya.com/en/docs/iot/hjjcy?id=Kbeoad8y1nnlv + """ HXD = "hxd" """Wake Up Light II (undocumented)""" JDCLJQR = "jdcljqr" @@ -502,6 +527,8 @@ class DeviceCategory(StrEnum): Found as VECINO RGBW as provided by diagnostics """ + QCCDZ = "qccdz" + """AC charging (undocumented)""" QJDCZ = "qjdcz" """ Unknown product with light capabilities @@ -516,6 +543,8 @@ class DeviceCategory(StrEnum): """Smart Water Timer (undocumented)""" SJZ = "sjz" """Electric desk (undocumented)""" + SZJCY = "szjcy" + """Water tester (undocumented)""" SZJQR = "szjqr" """Fingerbot (undocumented)""" SWTZ = "swtz" @@ -531,8 +560,19 @@ class DeviceCategory(StrEnum): https://developer.tuya.com/en/docs/iot/wg?id=Kbcdadk79ejok """ + WKCZ = "wkcz" + """Two-way temperature and humidity switch (undocumented) + + "MOES Temperature and Humidity Smart Switch Module MS-103" + """ WKF = "wkf" """Thermostatic Radiator Valve (undocumented)""" + WNYKQ = "wnykq" + """Smart WiFi IR Remote (undocumented) + + eMylo Smart WiFi IR Remote + Air Conditioner Mate (Smart IR Socket) + """ WXKG = "wxkg" # Documented, but not in official list """Wireless Switch @@ -545,8 +585,14 @@ class DeviceCategory(StrEnum): """ YWCGQ = "ywcgq" """Tank Level Sensor (undocumented)""" + ZNNBQ = "znnbq" + """VESKA-micro inverter (undocumented)""" + ZWJCY = "zwjcy" + """Soil sensor - plant monitor (undocumented)""" + ZNJXS = "znjxs" + """Hejhome whitelabel Fingerbot (undocumented)""" ZNRB = "znrb" - """Pool HeatPump""" + """Pool HeatPump (undocumented)""" class DPCode(StrEnum): diff --git a/homeassistant/components/tuya/cover.py b/homeassistant/components/tuya/cover.py index 3464b535c474..16fa9f294ea6 100644 --- a/homeassistant/components/tuya/cover.py +++ b/homeassistant/components/tuya/cover.py @@ -20,7 +20,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from . import TuyaConfigEntry -from .const import TUYA_DISCOVERY_NEW, DPCode, DPType +from .const import TUYA_DISCOVERY_NEW, DeviceCategory, DPCode, DPType from .entity import TuyaEntity from .models import EnumTypeData, IntegerTypeData from .util import get_dpcode @@ -40,10 +40,8 @@ class TuyaCoverEntityDescription(CoverEntityDescription): motor_reverse_mode: DPCode | None = None -COVERS: dict[str, tuple[TuyaCoverEntityDescription, ...]] = { - # Garage Door Opener - # https://developer.tuya.com/en/docs/iot/categoryckmkzq?id=Kaiuz0ipcboee - "ckmkzq": ( +COVERS: dict[DeviceCategory, tuple[TuyaCoverEntityDescription, ...]] = { + DeviceCategory.CKMKZQ: ( TuyaCoverEntityDescription( key=DPCode.SWITCH_1, translation_key="indexed_door", @@ -69,10 +67,7 @@ COVERS: dict[str, tuple[TuyaCoverEntityDescription, ...]] = { device_class=CoverDeviceClass.GARAGE, ), ), - # Curtain - # Note: Multiple curtains isn't documented - # https://developer.tuya.com/en/docs/iot/categorycl?id=Kaiuz1hnpo7df - "cl": ( + DeviceCategory.CL: ( TuyaCoverEntityDescription( key=DPCode.CONTROL, translation_key="curtain", @@ -117,9 +112,7 @@ COVERS: dict[str, tuple[TuyaCoverEntityDescription, ...]] = { device_class=CoverDeviceClass.BLIND, ), ), - # Curtain Switch - # https://developer.tuya.com/en/docs/iot/category-clkg?id=Kaiuz0gitil39 - "clkg": ( + DeviceCategory.CLKG: ( TuyaCoverEntityDescription( key=DPCode.CONTROL, translation_key="curtain", @@ -138,9 +131,7 @@ COVERS: dict[str, tuple[TuyaCoverEntityDescription, ...]] = { device_class=CoverDeviceClass.CURTAIN, ), ), - # Curtain Robot - # Note: Not documented - "jdcljqr": ( + DeviceCategory.JDCLJQR: ( TuyaCoverEntityDescription( key=DPCode.CONTROL, translation_key="curtain", diff --git a/homeassistant/components/tuya/sensor.py b/homeassistant/components/tuya/sensor.py index 3851287ce466..f00b034c8a24 100644 --- a/homeassistant/components/tuya/sensor.py +++ b/homeassistant/components/tuya/sensor.py @@ -37,6 +37,7 @@ from .const import ( DOMAIN, LOGGER, TUYA_DISCOVERY_NEW, + DeviceCategory, DPCode, DPType, UnitOfMeasurement, @@ -115,11 +116,8 @@ BATTERY_SENSORS: tuple[TuyaSensorEntityDescription, ...] = ( # All descriptions can be found here. Mostly the Integer data types in the # default status set of each category (that don't have a set instruction) # end up being a sensor. -# https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq -SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { - # Single Phase power meter - # Note: Undocumented - "aqcz": ( +SENSORS: dict[DeviceCategory, tuple[TuyaSensorEntityDescription, ...]] = { + DeviceCategory.AQCZ: ( TuyaSensorEntityDescription( key=DPCode.CUR_CURRENT, translation_key="current", @@ -144,9 +142,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { entity_registry_enabled_default=False, ), ), - # Smart Kettle - # https://developer.tuya.com/en/docs/iot/fbh?id=K9gf484m21yq7 - "bh": ( + DeviceCategory.BH: ( TuyaSensorEntityDescription( key=DPCode.TEMP_CURRENT, translation_key="current_temperature", @@ -164,18 +160,14 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { translation_key="status", ), ), - # Curtain - # https://developer.tuya.com/en/docs/iot/s?id=K9gf48qy7wkre - "cl": ( + DeviceCategory.CL: ( TuyaSensorEntityDescription( key=DPCode.TIME_TOTAL, translation_key="last_operation_duration", entity_category=EntityCategory.DIAGNOSTIC, ), ), - # CO2 Detector - # https://developer.tuya.com/en/docs/iot/categoryco2bj?id=Kaiuz3wes7yuy - "co2bj": ( + DeviceCategory.CO2BJ: ( TuyaSensorEntityDescription( key=DPCode.HUMIDITY_VALUE, translation_key="humidity", @@ -221,9 +213,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # CO Detector - # https://developer.tuya.com/en/docs/iot/categorycobj?id=Kaiuz3u1j6q1v - "cobj": ( + DeviceCategory.COBJ: ( TuyaSensorEntityDescription( key=DPCode.CO_VALUE, translation_key="carbon_monoxide", @@ -233,9 +223,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Dehumidifier - # https://developer.tuya.com/en/docs/iot/s?id=K9gf48r6jke8e - "cs": ( + DeviceCategory.CS: ( TuyaSensorEntityDescription( key=DPCode.TEMP_INDOOR, translation_key="temperature", @@ -249,27 +237,21 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, ), ), - # Smart Odor Eliminator-Pro - # Undocumented, see https://github.com/orgs/home-assistant/discussions/79 - "cwjwq": ( + DeviceCategory.CWJWQ: ( TuyaSensorEntityDescription( key=DPCode.WORK_STATE_E, translation_key="odor_elimination_status", ), *BATTERY_SENSORS, ), - # Smart Pet Feeder - # https://developer.tuya.com/en/docs/iot/categorycwwsq?id=Kaiuz2b6vydld - "cwwsq": ( + DeviceCategory.CWWSQ: ( TuyaSensorEntityDescription( key=DPCode.FEED_REPORT, translation_key="last_amount", state_class=SensorStateClass.MEASUREMENT, ), ), - # Pet Fountain - # https://developer.tuya.com/en/docs/iot/s?id=K9gf48r0as4ln - "cwysj": ( + DeviceCategory.CWYSJ: ( TuyaSensorEntityDescription( key=DPCode.UV_RUNTIME, translation_key="uv_runtime", @@ -300,9 +282,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { key=DPCode.WATER_LEVEL, translation_key="water_level_state" ), ), - # Multi-functional Sensor - # https://developer.tuya.com/en/docs/iot/categorydgnbj?id=Kaiuz3yorvzg3 - "dgnbj": ( + DeviceCategory.DGNBJ: ( TuyaSensorEntityDescription( key=DPCode.GAS_SENSOR_VALUE, translation_key="gas", @@ -376,9 +356,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Circuit Breaker - # https://developer.tuya.com/en/docs/iot/dlq?id=Kb0kidk9enyh8 - "dlq": ( + DeviceCategory.DLQ: ( TuyaSensorEntityDescription( key=DPCode.TOTAL_FORWARD_ENERGY, translation_key="total_energy", @@ -515,9 +493,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { entity_registry_enabled_default=False, ), ), - # Fan - # https://developer.tuya.com/en/docs/iot/s?id=K9gf48quojr54 - "fs": ( + DeviceCategory.FS: ( TuyaSensorEntityDescription( key=DPCode.TEMP_CURRENT, translation_key="temperature", @@ -525,12 +501,8 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, ), ), - # Irrigator - # https://developer.tuya.com/en/docs/iot/categoryggq?id=Kaiuz1qib7z0k - "ggq": BATTERY_SENSORS, - # Air Quality Monitor - # https://developer.tuya.com/en/docs/iot/hjjcy?id=Kbeoad8y1nnlv - "hjjcy": ( + DeviceCategory.GGQ: BATTERY_SENSORS, + DeviceCategory.HJJCY: ( TuyaSensorEntityDescription( key=DPCode.AIR_QUALITY_INDEX, translation_key="air_quality_index", @@ -581,9 +553,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Formaldehyde Detector - # Note: Not documented - "jqbj": ( + DeviceCategory.JQBJ: ( TuyaSensorEntityDescription( key=DPCode.CO2_VALUE, translation_key="carbon_dioxide", @@ -623,9 +593,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Humidifier - # https://developer.tuya.com/en/docs/iot/s?id=K9gf48qwjz0i3 - "jsq": ( + DeviceCategory.JSQ: ( TuyaSensorEntityDescription( key=DPCode.HUMIDITY_CURRENT, translation_key="humidity", @@ -650,9 +618,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { entity_category=EntityCategory.DIAGNOSTIC, ), ), - # Methane Detector - # https://developer.tuya.com/en/docs/iot/categoryjwbj?id=Kaiuz40u98lkm - "jwbj": ( + DeviceCategory.JWBJ: ( TuyaSensorEntityDescription( key=DPCode.CH4_SENSOR_VALUE, translation_key="methane", @@ -660,9 +626,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Switch - # https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s - "kg": ( + DeviceCategory.KG: ( TuyaSensorEntityDescription( key=DPCode.CUR_CURRENT, translation_key="current", @@ -699,9 +663,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.TOTAL_INCREASING, ), ), - # Air Purifier - # https://developer.tuya.com/en/docs/iot/s?id=K9gf48r41mn81 - "kj": ( + DeviceCategory.KJ: ( TuyaSensorEntityDescription( key=DPCode.FILTER, translation_key="filter_utilization", @@ -756,9 +718,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { translation_key="air_quality", ), ), - # Luminance Sensor - # https://developer.tuya.com/en/docs/iot/categoryldcg?id=Kaiuz3n7u69l8 - "ldcg": ( + DeviceCategory.LDCG: ( TuyaSensorEntityDescription( key=DPCode.BRIGHT_STATE, translation_key="luminosity", @@ -790,15 +750,9 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Door and Window Controller - # https://developer.tuya.com/en/docs/iot/s?id=K9gf48r5zjsy9 - "mc": BATTERY_SENSORS, - # Door Window Sensor - # https://developer.tuya.com/en/docs/iot/s?id=K9gf48hm02l8m - "mcs": BATTERY_SENSORS, - # Cat toilet - # https://developer.tuya.com/en/docs/iot/s?id=Kakg3srr4ora7 - "msp": ( + DeviceCategory.MC: BATTERY_SENSORS, + DeviceCategory.MCS: BATTERY_SENSORS, + DeviceCategory.MSP: ( TuyaSensorEntityDescription( key=DPCode.CAT_WEIGHT, translation_key="cat_weight", @@ -806,9 +760,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, ), ), - # Sous Vide Cooker - # https://developer.tuya.com/en/docs/iot/categorymzj?id=Kaiuz2vy130ux - "mzj": ( + DeviceCategory.MZJ: ( TuyaSensorEntityDescription( key=DPCode.TEMP_CURRENT, translation_key="current_temperature", @@ -825,12 +777,8 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { native_unit_of_measurement=UnitOfTime.MINUTES, ), ), - # PIR Detector - # https://developer.tuya.com/en/docs/iot/categorypir?id=Kaiuz3ss11b80 - "pir": BATTERY_SENSORS, - # PM2.5 Sensor - # https://developer.tuya.com/en/docs/iot/categorypm25?id=Kaiuz3qof3yfu - "pm2.5": ( + DeviceCategory.PIR: BATTERY_SENSORS, + DeviceCategory.PM2_5: ( TuyaSensorEntityDescription( key=DPCode.PM25_VALUE, translation_key="pm25", @@ -884,9 +832,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Heater - # https://developer.tuya.com/en/docs/iot/categoryqn?id=Kaiuz18kih0sm - "qn": ( + DeviceCategory.QN: ( TuyaSensorEntityDescription( key=DPCode.WORK_POWER, translation_key="power", @@ -894,9 +840,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, ), ), - # Temperature and Humidity Sensor with External Probe - # New undocumented category qxj, see https://github.com/home-assistant/core/issues/136472 - "qxj": ( + DeviceCategory.QXJ: ( TuyaSensorEntityDescription( key=DPCode.VA_TEMPERATURE, translation_key="temperature", @@ -1018,9 +962,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Gas Detector - # https://developer.tuya.com/en/docs/iot/categoryrqbj?id=Kaiuz3d162ubw - "rqbj": ( + DeviceCategory.RQBJ: ( TuyaSensorEntityDescription( key=DPCode.GAS_SENSOR_VALUE, name=None, @@ -1029,9 +971,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Robot Vacuum - # https://developer.tuya.com/en/docs/iot/fsd?id=K9gf487ck1tlo - "sd": ( + DeviceCategory.SD: ( TuyaSensorEntityDescription( key=DPCode.CLEAN_AREA, translation_key="cleaning_area", @@ -1085,8 +1025,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, ), ), - # Smart Water Timer - "sfkzq": ( + DeviceCategory.SFKZQ: ( # Total seconds of irrigation. Read-write value; the device appears to ignore the write action (maybe firmware bug) TuyaSensorEntityDescription( key=DPCode.TIME_USE, @@ -1096,18 +1035,10 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Siren Alarm - # https://developer.tuya.com/en/docs/iot/categorysgbj?id=Kaiuz37tlpbnu - "sgbj": BATTERY_SENSORS, - # Water Detector - # https://developer.tuya.com/en/docs/iot/categorysj?id=Kaiuz3iub2sli - "sj": BATTERY_SENSORS, - # Emergency Button - # https://developer.tuya.com/en/docs/iot/categorysos?id=Kaiuz3oi6agjy - "sos": BATTERY_SENSORS, - # Smart Camera - # https://developer.tuya.com/en/docs/iot/categorysp?id=Kaiuz35leyo12 - "sp": ( + DeviceCategory.SGBJ: BATTERY_SENSORS, + DeviceCategory.SJ: BATTERY_SENSORS, + DeviceCategory.SOS: BATTERY_SENSORS, + DeviceCategory.SP: ( TuyaSensorEntityDescription( key=DPCode.SENSOR_TEMPERATURE, translation_key="temperature", @@ -1128,8 +1059,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, ), ), - # Cooking thermometer - "swtz": ( + DeviceCategory.SWTZ: ( TuyaSensorEntityDescription( key=DPCode.TEMP_CURRENT, translation_key="temperature", @@ -1145,9 +1075,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Smart Gardening system - # https://developer.tuya.com/en/docs/iot/categorysz?id=Kaiuz4e6h7up0 - "sz": ( + DeviceCategory.SZ: ( TuyaSensorEntityDescription( key=DPCode.TEMP_CURRENT, translation_key="temperature", @@ -1161,8 +1089,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, ), ), - # Water tester - "szjcy": ( + DeviceCategory.SZJCY: ( TuyaSensorEntityDescription( key=DPCode.TDS_IN, translation_key="total_dissolved_solids", @@ -1176,11 +1103,8 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Fingerbot - "szjqr": BATTERY_SENSORS, - # IoT Switch - # Note: Undocumented - "tdq": ( + DeviceCategory.SZJQR: BATTERY_SENSORS, + DeviceCategory.TDQ: ( TuyaSensorEntityDescription( key=DPCode.CUR_CURRENT, translation_key="current", @@ -1242,12 +1166,8 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Solar Light - # https://developer.tuya.com/en/docs/iot/tynd?id=Kaof8j02e1t98 - "tyndj": BATTERY_SENSORS, - # Volatile Organic Compound Sensor - # Note: Undocumented in cloud API docs, based on test device - "voc": ( + DeviceCategory.TYNDJ: BATTERY_SENSORS, + DeviceCategory.VOC: ( TuyaSensorEntityDescription( key=DPCode.CO2_VALUE, translation_key="carbon_dioxide", @@ -1287,13 +1207,8 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Thermostat - # https://developer.tuya.com/en/docs/iot/f?id=K9gf45ld5l0t9 - "wk": (*BATTERY_SENSORS,), - # Two-way temperature and humidity switch - # "MOES Temperature and Humidity Smart Switch Module MS-103" - # Documentation not found - "wkcz": ( + DeviceCategory.WK: (*BATTERY_SENSORS,), + DeviceCategory.WKCZ: ( TuyaSensorEntityDescription( key=DPCode.HUMIDITY_VALUE, translation_key="humidity", @@ -1330,12 +1245,8 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { entity_registry_enabled_default=False, ), ), - # Thermostatic Radiator Valve - # Not documented - "wkf": BATTERY_SENSORS, - # eMylo Smart WiFi IR Remote - # Air Conditioner Mate (Smart IR Socket) - "wnykq": ( + DeviceCategory.WKF: BATTERY_SENSORS, + DeviceCategory.WNYKQ: ( TuyaSensorEntityDescription( key=DPCode.VA_TEMPERATURE, translation_key="temperature", @@ -1375,9 +1286,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { entity_registry_enabled_default=False, ), ), - # Temperature and Humidity Sensor - # https://developer.tuya.com/en/docs/iot/categorywsdcg?id=Kaiuz3hinij34 - "wsdcg": ( + DeviceCategory.WSDCG: ( TuyaSensorEntityDescription( key=DPCode.VA_TEMPERATURE, translation_key="temperature", @@ -1410,12 +1319,8 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Wireless Switch - # https://developer.tuya.com/en/docs/iot/s?id=Kbeoa9fkv6brp - "wxkg": BATTERY_SENSORS, # Pressure Sensor - # Micro Storage Inverter - # Energy storage and solar PV inverter system with monitoring capabilities - "xnyjcn": ( + DeviceCategory.WXKG: BATTERY_SENSORS, + DeviceCategory.XNYJCN: ( TuyaSensorEntityDescription( key=DPCode.CURRENT_SOC, translation_key="battery_soc", @@ -1486,8 +1391,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.TOTAL_INCREASING, ), ), - # https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm - "ylcg": ( + DeviceCategory.YLCG: ( TuyaSensorEntityDescription( key=DPCode.PRESSURE_VALUE, name=None, @@ -1496,9 +1400,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Smoke Detector - # https://developer.tuya.com/en/docs/iot/categoryywbj?id=Kaiuz3f6sf952 - "ywbj": ( + DeviceCategory.YWBJ: ( TuyaSensorEntityDescription( key=DPCode.SMOKE_SENSOR_VALUE, translation_key="smoke_amount", @@ -1507,9 +1409,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { ), *BATTERY_SENSORS, ), - # Tank Level Sensor - # Note: Undocumented - "ywcgq": ( + DeviceCategory.YWCGQ: ( TuyaSensorEntityDescription( key=DPCode.LIQUID_STATE, translation_key="liquid_state", @@ -1526,12 +1426,8 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, ), ), - # Vibration Sensor - # https://developer.tuya.com/en/docs/iot/categoryzd?id=Kaiuz3a5vrzno - "zd": BATTERY_SENSORS, - # Smart Electricity Meter - # https://developer.tuya.com/en/docs/iot/smart-meter?id=Kaiuz4gv6ack7 - "zndb": ( + DeviceCategory.ZD: BATTERY_SENSORS, + DeviceCategory.ZNDB: ( TuyaSensorEntityDescription( key=DPCode.FORWARD_ENERGY_TOTAL, translation_key="total_energy", @@ -1647,8 +1543,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { subkey="voltage", ), ), - # VESKA-micro inverter - "znnbq": ( + DeviceCategory.ZNNBQ: ( TuyaSensorEntityDescription( key=DPCode.REVERSE_ENERGY_TOTAL, translation_key="total_energy", @@ -1671,8 +1566,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, ), ), - # Pool HeatPump - "znrb": ( + DeviceCategory.ZNRB: ( TuyaSensorEntityDescription( key=DPCode.TEMP_CURRENT, translation_key="temperature", @@ -1680,8 +1574,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, ), ), - # Soil sensor (Plant monitor) - "zwjcy": ( + DeviceCategory.ZWJCY: ( TuyaSensorEntityDescription( key=DPCode.TEMP_CURRENT, translation_key="temperature", @@ -1699,16 +1592,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = { } # Socket (duplicate of `kg`) -# https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s -SENSORS["cz"] = SENSORS["kg"] +SENSORS[DeviceCategory.CZ] = SENSORS[DeviceCategory.KG] # Smart Camera - Low power consumption camera (duplicate of `sp`) -# Undocumented, see https://github.com/home-assistant/core/issues/132844 -SENSORS["dghsxj"] = SENSORS["sp"] +SENSORS[DeviceCategory.DGHSXJ] = SENSORS[DeviceCategory.SP] # Power Socket (duplicate of `kg`) -# https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s -SENSORS["pc"] = SENSORS["kg"] +SENSORS[DeviceCategory.PC] = SENSORS[DeviceCategory.KG] async def async_setup_entry( diff --git a/homeassistant/components/tuya/switch.py b/homeassistant/components/tuya/switch.py index d34123e02711..a12562b455fe 100644 --- a/homeassistant/components/tuya/switch.py +++ b/homeassistant/components/tuya/switch.py @@ -25,7 +25,7 @@ from homeassistant.helpers.issue_registry import ( ) from . import TuyaConfigEntry -from .const import DOMAIN, TUYA_DISCOVERY_NEW, DPCode +from .const import DOMAIN, TUYA_DISCOVERY_NEW, DeviceCategory, DPCode from .entity import TuyaEntity @@ -40,10 +40,8 @@ class TuyaDeprecatedSwitchEntityDescription(SwitchEntityDescription): # All descriptions can be found here. Mostly the Boolean data types in the # default instruction set of each category end up being a Switch. # https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq -SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { - # Smart Kettle - # https://developer.tuya.com/en/docs/iot/fbh?id=K9gf484m21yq7 - "bh": ( +SWITCHES: dict[DeviceCategory, tuple[SwitchEntityDescription, ...]] = { + DeviceCategory.BH: ( SwitchEntityDescription( key=DPCode.START, translation_key="start", @@ -54,8 +52,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # White noise machine - "bzyd": ( + DeviceCategory.BZYD: ( SwitchEntityDescription( key=DPCode.SWITCH, name=None, @@ -79,9 +76,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Curtain - # https://developer.tuya.com/en/docs/iot/f?id=K9gf46o5mtfyc - "cl": ( + DeviceCategory.CL: ( SwitchEntityDescription( key=DPCode.CONTROL_BACK, translation_key="reverse", @@ -93,9 +88,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # EasyBaby - # Undocumented, might have a wider use - "cn": ( + DeviceCategory.CN: ( SwitchEntityDescription( key=DPCode.DISINFECTION, translation_key="disinfection", @@ -105,9 +98,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { translation_key="water", ), ), - # Dehumidifier - # https://developer.tuya.com/en/docs/iot/s?id=K9gf48r6jke8e - "cs": ( + DeviceCategory.CS: ( SwitchEntityDescription( key=DPCode.ANION, translation_key="ionizer", @@ -127,26 +118,20 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Smart Odor Eliminator-Pro - # Undocumented, see https://github.com/orgs/home-assistant/discussions/79 - "cwjwq": ( + DeviceCategory.CWJWQ: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", ), ), - # Smart Pet Feeder - # https://developer.tuya.com/en/docs/iot/categorycwwsq?id=Kaiuz2b6vydld - "cwwsq": ( + DeviceCategory.CWWSQ: ( SwitchEntityDescription( key=DPCode.SLOW_FEED, translation_key="slow_feed", entity_category=EntityCategory.CONFIG, ), ), - # Pet Fountain - # https://developer.tuya.com/en/docs/iot/f?id=K9gf46aewxem5 - "cwysj": ( + DeviceCategory.CWYSJ: ( SwitchEntityDescription( key=DPCode.FILTER_RESET, translation_key="filter_reset", @@ -172,9 +157,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Light - # https://developer.tuya.com/en/docs/iot/f?id=K9i5ql3v98hn3 - "dj": ( + DeviceCategory.DJ: ( # There are sockets available with an RGB light # that advertise as `dj`, but provide an additional # switch to control the plug. @@ -183,8 +166,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { translation_key="plug", ), ), - # Circuit Breaker - "dlq": ( + DeviceCategory.DLQ: ( SwitchEntityDescription( key=DPCode.CHILD_LOCK, translation_key="child_lock", @@ -195,9 +177,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { translation_key="switch", ), ), - # Electric Blanket - # https://developer.tuya.com/en/docs/iot/categorydr?id=Kaiuz22dyc66p - "dr": ( + DeviceCategory.DR: ( SwitchEntityDescription( key=DPCode.SWITCH, name="Power", @@ -235,9 +215,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { device_class=SwitchDeviceClass.SWITCH, ), ), - # Fan - # https://developer.tuya.com/en/docs/iot/categoryfs?id=Kaiuz1xweel1c - "fs": ( + DeviceCategory.FS: ( SwitchEntityDescription( key=DPCode.ANION, translation_key="anion", @@ -269,18 +247,14 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Ceiling Fan Light - # https://developer.tuya.com/en/docs/iot/fsd?id=Kaof8eiei4c2v - "fsd": ( + DeviceCategory.FSD: ( SwitchEntityDescription( key=DPCode.FAN_BEEP, translation_key="sound", entity_category=EntityCategory.CONFIG, ), ), - # Irrigator - # https://developer.tuya.com/en/docs/iot/categoryggq?id=Kaiuz1qib7z0k - "ggq": ( + DeviceCategory.GGQ: ( SwitchEntityDescription( key=DPCode.SWITCH_1, translation_key="indexed_switch", @@ -322,9 +296,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { translation_placeholders={"index": "8"}, ), ), - # Wake Up Light II - # Not documented - "hxd": ( + DeviceCategory.HXD: ( SwitchEntityDescription( key=DPCode.SWITCH_1, translation_key="radio", @@ -358,9 +330,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { translation_key="sleep_aid", ), ), - # Humidifier - # https://developer.tuya.com/en/docs/iot/categoryjsq?id=Kaiuz1smr440b - "jsq": ( + DeviceCategory.JSQ: ( SwitchEntityDescription( key=DPCode.SWITCH_SOUND, translation_key="voice", @@ -377,9 +347,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Switch - # https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s - "kg": ( + DeviceCategory.KG: ( SwitchEntityDescription( key=DPCode.CHILD_LOCK, translation_key="child_lock", @@ -469,9 +437,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { device_class=SwitchDeviceClass.OUTLET, ), ), - # Air Purifier - # https://developer.tuya.com/en/docs/iot/f?id=K9gf46h2s6dzm - "kj": ( + DeviceCategory.KJ: ( SwitchEntityDescription( key=DPCode.ANION, translation_key="ionizer", @@ -502,9 +468,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Air conditioner - # https://developer.tuya.com/en/docs/iot/categorykt?id=Kaiuz0z71ov2n - "kt": ( + DeviceCategory.KT: ( SwitchEntityDescription( key=DPCode.ANION, translation_key="ionizer", @@ -516,17 +480,13 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Undocumented tower fan - # https://github.com/orgs/home-assistant/discussions/329 - "ks": ( + DeviceCategory.KS: ( SwitchEntityDescription( key=DPCode.ANION, translation_key="ionizer", ), ), - # Alarm Host - # https://developer.tuya.com/en/docs/iot/alarm-hosts?id=K9gf48r87hyjk - "mal": ( + DeviceCategory.MAL: ( SwitchEntityDescription( key=DPCode.SWITCH_ALARM_SOUND, # This switch is called "Arm Beep" in the official Tuya app @@ -540,9 +500,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Sous Vide Cooker - # https://developer.tuya.com/en/docs/iot/categorymzj?id=Kaiuz2vy130ux - "mzj": ( + DeviceCategory.MZJ: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", @@ -554,9 +512,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Power Socket - # https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s - "pc": ( + DeviceCategory.PC: ( SwitchEntityDescription( key=DPCode.CHILD_LOCK, translation_key="child_lock", @@ -634,26 +590,19 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { device_class=SwitchDeviceClass.OUTLET, ), ), - # AC charging - # Not documented - "qccdz": ( + DeviceCategory.QCCDZ: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", ), ), - # Unknown product with switch capabilities - # Fond in some diffusers, plugs and PIR flood lights - # Not documented - "qjdcz": ( + DeviceCategory.QJDCZ: ( SwitchEntityDescription( key=DPCode.SWITCH_1, translation_key="switch", ), ), - # Heater - # https://developer.tuya.com/en/docs/iot/categoryqn?id=Kaiuz18kih0sm - "qn": ( + DeviceCategory.QN: ( SwitchEntityDescription( key=DPCode.ANION, translation_key="ionizer", @@ -665,18 +614,14 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # SIREN: Siren (switch) with Temperature and Humidity Sensor with External Probe - # New undocumented category qxj, see https://github.com/home-assistant/core/issues/136472 - "qxj": ( + DeviceCategory.QXJ: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", device_class=SwitchDeviceClass.OUTLET, ), ), - # Robot Vacuum - # https://developer.tuya.com/en/docs/iot/fsd?id=K9gf487ck1tlo - "sd": ( + DeviceCategory.SD: ( SwitchEntityDescription( key=DPCode.SWITCH_DISTURB, translation_key="do_not_disturb", @@ -688,8 +633,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Smart Water Timer - "sfkzq": ( + DeviceCategory.SFKZQ: ( TuyaDeprecatedSwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", @@ -697,26 +641,21 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { breaks_in_ha_version="2026.4.0", ), ), - # Siren Alarm - # https://developer.tuya.com/en/docs/iot/categorysgbj?id=Kaiuz37tlpbnu - "sgbj": ( + DeviceCategory.SGBJ: ( SwitchEntityDescription( key=DPCode.MUFFLING, translation_key="mute", entity_category=EntityCategory.CONFIG, ), ), - # Electric desk - "sjz": ( + DeviceCategory.SJZ: ( SwitchEntityDescription( key=DPCode.CHILD_LOCK, translation_key="child_lock", entity_category=EntityCategory.CONFIG, ), ), - # Smart Camera - # https://developer.tuya.com/en/docs/iot/categorysp?id=Kaiuz35leyo12 - "sp": ( + DeviceCategory.SP: ( SwitchEntityDescription( key=DPCode.WIRELESS_BATTERYLOCK, translation_key="battery_lock", @@ -773,9 +712,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Smart Gardening system - # https://developer.tuya.com/en/docs/iot/categorysz?id=Kaiuz4e6h7up0 - "sz": ( + DeviceCategory.SZ: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="power", @@ -785,16 +722,13 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { translation_key="pump", ), ), - # Fingerbot - "szjqr": ( + DeviceCategory.SZJQR: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", ), ), - # IoT Switch? - # Note: Undocumented - "tdq": ( + DeviceCategory.TDQ: ( SwitchEntityDescription( key=DPCode.SWITCH_1, translation_key="indexed_switch", @@ -837,27 +771,21 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Solar Light - # https://developer.tuya.com/en/docs/iot/tynd?id=Kaof8j02e1t98 - "tyndj": ( + DeviceCategory.TYNDJ: ( SwitchEntityDescription( key=DPCode.SWITCH_SAVE_ENERGY, translation_key="energy_saving", entity_category=EntityCategory.CONFIG, ), ), - # Gateway control - # https://developer.tuya.com/en/docs/iot/wg?id=Kbcdadk79ejok - "wg2": ( + DeviceCategory.WG2: ( SwitchEntityDescription( key=DPCode.MUFFLING, translation_key="mute", entity_category=EntityCategory.CONFIG, ), ), - # Thermostat - # https://developer.tuya.com/en/docs/iot/f?id=K9gf45ld5l0t9 - "wk": ( + DeviceCategory.WK: ( SwitchEntityDescription( key=DPCode.CHILD_LOCK, translation_key="child_lock", @@ -869,10 +797,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Two-way temperature and humidity switch - # "MOES Temperature and Humidity Smart Switch Module MS-103" - # Documentation not found - "wkcz": ( + DeviceCategory.WKCZ: ( SwitchEntityDescription( key=DPCode.SWITCH_1, translation_key="indexed_switch", @@ -886,9 +811,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { device_class=SwitchDeviceClass.OUTLET, ), ), - # Thermostatic Radiator Valve - # Not documented - "wkf": ( + DeviceCategory.WKF: ( SwitchEntityDescription( key=DPCode.CHILD_LOCK, translation_key="child_lock", @@ -900,43 +823,34 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Air Conditioner Mate (Smart IR Socket) - "wnykq": ( + DeviceCategory.WNYKQ: ( SwitchEntityDescription( key=DPCode.SWITCH, name=None, ), ), - # SIREN: Siren (switch) with Temperature and humidity sensor - # https://developer.tuya.com/en/docs/iot/f?id=Kavck4sr3o5ek - "wsdcg": ( + DeviceCategory.WSDCG: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", device_class=SwitchDeviceClass.OUTLET, ), ), - # Ceiling Light - # https://developer.tuya.com/en/docs/iot/ceiling-light?id=Kaiuz03xxfc4r - "xdd": ( + DeviceCategory.XDD: ( SwitchEntityDescription( key=DPCode.DO_NOT_DISTURB, translation_key="do_not_disturb", entity_category=EntityCategory.CONFIG, ), ), - # Micro Storage Inverter - # Energy storage and solar PV inverter system with monitoring capabilities - "xnyjcn": ( + DeviceCategory.XNYJCN: ( SwitchEntityDescription( key=DPCode.FEEDIN_POWER_LIMIT_ENABLE, translation_key="output_power_limit", entity_category=EntityCategory.CONFIG, ), ), - # Diffuser - # https://developer.tuya.com/en/docs/iot/categoryxxj?id=Kaiuz1f9mo6bl - "xxj": ( + DeviceCategory.XXJ: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="power", @@ -951,32 +865,26 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), - # Smoke Detector - # https://developer.tuya.com/en/docs/iot/categoryywbj?id=Kaiuz3f6sf952 - "ywbj": ( + DeviceCategory.YWBJ: ( SwitchEntityDescription( key=DPCode.MUFFLING, translation_key="mute", entity_category=EntityCategory.CONFIG, ), ), - # Smart Electricity Meter - # https://developer.tuya.com/en/docs/iot/smart-meter?id=Kaiuz4gv6ack7 - "zndb": ( + DeviceCategory.ZNDB: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", ), ), - # Hejhome whitelabel Fingerbot - "znjxs": ( + DeviceCategory.ZNJXS: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", ), ), - # Pool HeatPump - "znrb": ( + DeviceCategory.ZNRB: ( SwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", @@ -985,12 +893,10 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { } # Socket (duplicate of `pc`) -# https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s -SWITCHES["cz"] = SWITCHES["pc"] +SWITCHES[DeviceCategory.CZ] = SWITCHES[DeviceCategory.PC] # Smart Camera - Low power consumption camera (duplicate of `sp`) -# Undocumented, see https://github.com/home-assistant/core/issues/132844 -SWITCHES["dghsxj"] = SWITCHES["sp"] +SWITCHES[DeviceCategory.DGHSXJ] = SWITCHES[DeviceCategory.SP] async def async_setup_entry(