diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 88164e86f3803..424c9b82e3605 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -658,6 +658,7 @@ class DPCode(StrEnum): COLOUR_DATA = "colour_data" # Colored light mode COLOUR_DATA_HSV = "colour_data_hsv" # Colored light mode COLOUR_DATA_V2 = "colour_data_v2" # Colored light mode + COMPRESSOR_STRENGTH = "compressor_strength" CONCENTRATION_SET = "concentration_set" # Concentration setting CONTROL = "control" CONTROL_2 = "control_2" @@ -911,8 +912,10 @@ class DPCode(StrEnum): TARGET_DIS_CLOSEST = "target_dis_closest" # Closest target distance TDS_IN = "tds_in" # Total dissolved solids TEMP = "temp" # Temperature setting + TEMP_AROUND = "temp_around" # Current around (outside) temperature TEMP_BOILING_C = "temp_boiling_c" TEMP_BOILING_F = "temp_boiling_f" + TEMP_COILER = "temp_coiler" # Current coil temperature TEMP_CONTROLLER = "temp_controller" TEMP_CORRECTION = "temp_correction" TEMP_CURRENT = "temp_current" # Current temperature in °C @@ -933,12 +936,14 @@ class DPCode(StrEnum): "temp_current_external_f" # Current external temperature in Fahrenheit ) TEMP_CURRENT_F = "temp_current_f" # Current temperature in °F + TEMP_EFFLUENT = "temp_effluent" # Current flow temperature TEMP_INDOOR = "temp_indoor" # Indoor temperature in °C TEMP_SET = "temp_set" # Set the temperature in °C TEMP_SET_F = "temp_set_f" # Set the temperature in °F TEMP_UNIT_CONVERT = "temp_unit_convert" # Temperature unit switching TEMP_VALUE = "temp_value" # Color temperature TEMP_VALUE_V2 = "temp_value_v2" + TEMP_VENTING = "temp_venting" # Current heat plate temperature TEMPER_ALARM = "temper_alarm" # Tamper alarm TIME_TOTAL = "time_total" TIME_USE = "time_use" # Total seconds of irrigation diff --git a/homeassistant/components/tuya/sensor.py b/homeassistant/components/tuya/sensor.py index efea7624c8229..ecfadaa3613a6 100644 --- a/homeassistant/components/tuya/sensor.py +++ b/homeassistant/components/tuya/sensor.py @@ -1613,12 +1613,41 @@ class TuyaSensorEntityDescription(SensorEntityDescription): ), ), DeviceCategory.ZNRB: ( + TuyaSensorEntityDescription( + key=DPCode.COMPRESSOR_STRENGTH, + translation_key="compressor_strength", + state_class=SensorStateClass.MEASUREMENT, + ), + TuyaSensorEntityDescription( + key=DPCode.TEMP_AROUND, + translation_key="outside_temperature", + device_class=SensorDeviceClass.TEMPERATURE, + state_class=SensorStateClass.MEASUREMENT, + ), + TuyaSensorEntityDescription( + key=DPCode.TEMP_COILER, + translation_key="coil_temperature", + device_class=SensorDeviceClass.TEMPERATURE, + state_class=SensorStateClass.MEASUREMENT, + ), TuyaSensorEntityDescription( key=DPCode.TEMP_CURRENT, translation_key="temperature", device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, ), + TuyaSensorEntityDescription( + key=DPCode.TEMP_EFFLUENT, + translation_key="flow_temperature", + device_class=SensorDeviceClass.TEMPERATURE, + state_class=SensorStateClass.MEASUREMENT, + ), + TuyaSensorEntityDescription( + key=DPCode.TEMP_VENTING, + translation_key="heat_exchanger_temperature", + device_class=SensorDeviceClass.TEMPERATURE, + state_class=SensorStateClass.MEASUREMENT, + ), ), DeviceCategory.ZWJCY: ( TuyaSensorEntityDescription( diff --git a/homeassistant/components/tuya/strings.json b/homeassistant/components/tuya/strings.json index dbaec21073f8b..2f69b4f21b440 100644 --- a/homeassistant/components/tuya/strings.json +++ b/homeassistant/components/tuya/strings.json @@ -655,6 +655,12 @@ "cleaning_time": { "name": "Cleaning time" }, + "coil_temperature": { + "name": "Coil temperature" + }, + "compressor_strength": { + "name": "Compressor strength" + }, "concentration_carbon_dioxide": { "name": "Concentration of carbon dioxide" }, @@ -691,12 +697,18 @@ "filter_utilization": { "name": "Filter utilization" }, + "flow_temperature": { + "name": "Flow temperature" + }, "formaldehyde": { "name": "[%key:component::tuya::entity::binary_sensor::formaldehyde::name%]" }, "gas": { "name": "Gas" }, + "heat_exchanger_temperature": { + "name": "Heat exchanger temperature" + }, "heat_index_temperature": { "name": "Heat index" }, @@ -779,6 +791,9 @@ "work": "Working" } }, + "outside_temperature": { + "name": "Outside temperature" + }, "oxydo_reduction_potential": { "name": "Oxydo reduction potential" }, diff --git a/homeassistant/components/tuya/switch.py b/homeassistant/components/tuya/switch.py index 752a392a0941b..1c8053ac92c59 100644 --- a/homeassistant/components/tuya/switch.py +++ b/homeassistant/components/tuya/switch.py @@ -901,6 +901,12 @@ ), ), DeviceCategory.ZNRB: ( + SwitchEntityDescription( + key=DPCode.CHILD_LOCK, + translation_key="child_lock", + icon="mdi:account-lock", + entity_category=EntityCategory.CONFIG, + ), SwitchEntityDescription( key=DPCode.SWITCH, translation_key="switch", diff --git a/tests/components/tuya/snapshots/test_sensor.ambr b/tests/components/tuya/snapshots/test_sensor.ambr index 0d40194894a43..3bec5913775d3 100644 --- a/tests/components/tuya/snapshots/test_sensor.ambr +++ b/tests/components/tuya/snapshots/test_sensor.ambr @@ -9785,6 +9785,60 @@ 'state': '45.0', }) # --- +# name: test_platform_setup_and_discovery[sensor.hot_water_heat_pump_compressor_strength-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.hot_water_heat_pump_compressor_strength', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Compressor strength', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Compressor strength', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'compressor_strength', + 'unique_id': 'tuya.ol8xwtcj42eg18bdbrnzcompressor_strength', + 'unit_of_measurement': '℃', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.hot_water_heat_pump_compressor_strength-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Hot Water Heat Pump Compressor strength', + 'state_class': , + 'unit_of_measurement': '℃', + }), + 'context': , + 'entity_id': 'sensor.hot_water_heat_pump_compressor_strength', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '23.0', + }) +# --- # name: test_platform_setup_and_discovery[sensor.hot_water_heat_pump_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -11294,6 +11348,276 @@ 'state': 'unavailable', }) # --- +# name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_coil_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.inverter_pool_heat_pump_coil_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Coil temperature', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Coil temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'coil_temperature', + 'unique_id': 'tuya.zuqudhznfzttizpgbrnztemp_coiler', + 'unit_of_measurement': '', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_coil_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Inverter Pool Heat Pump Coil temperature', + 'state_class': , + 'unit_of_measurement': '', + }), + 'context': , + 'entity_id': 'sensor.inverter_pool_heat_pump_coil_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_compressor_strength-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.inverter_pool_heat_pump_compressor_strength', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Compressor strength', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Compressor strength', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'compressor_strength', + 'unique_id': 'tuya.zuqudhznfzttizpgbrnzcompressor_strength', + 'unit_of_measurement': '%', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_compressor_strength-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Inverter Pool Heat Pump Compressor strength', + 'state_class': , + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.inverter_pool_heat_pump_compressor_strength', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '100.0', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_flow_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.inverter_pool_heat_pump_flow_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Flow temperature', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Flow temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'flow_temperature', + 'unique_id': 'tuya.zuqudhznfzttizpgbrnztemp_effluent', + 'unit_of_measurement': '', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_flow_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Inverter Pool Heat Pump Flow temperature', + 'state_class': , + 'unit_of_measurement': '', + }), + 'context': , + 'entity_id': 'sensor.inverter_pool_heat_pump_flow_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '27.0', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_heat_exchanger_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.inverter_pool_heat_pump_heat_exchanger_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Heat exchanger temperature', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Heat exchanger temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'heat_exchanger_temperature', + 'unique_id': 'tuya.zuqudhznfzttizpgbrnztemp_venting', + 'unit_of_measurement': '', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_heat_exchanger_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Inverter Pool Heat Pump Heat exchanger temperature', + 'state_class': , + 'unit_of_measurement': '', + }), + 'context': , + 'entity_id': 'sensor.inverter_pool_heat_pump_heat_exchanger_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '79.0', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_outside_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.inverter_pool_heat_pump_outside_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Outside temperature', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Outside temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'outside_temperature', + 'unique_id': 'tuya.zuqudhznfzttizpgbrnztemp_around', + 'unit_of_measurement': '', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_outside_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Inverter Pool Heat Pump Outside temperature', + 'state_class': , + 'unit_of_measurement': '', + }), + 'context': , + 'entity_id': 'sensor.inverter_pool_heat_pump_outside_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '14.0', + }) +# --- # name: test_platform_setup_and_discovery[sensor.inverter_pool_heat_pump_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/tuya/snapshots/test_switch.ambr b/tests/components/tuya/snapshots/test_switch.ambr index 2ea39d37a2beb..a6c635ac5d193 100644 --- a/tests/components/tuya/snapshots/test_switch.ambr +++ b/tests/components/tuya/snapshots/test_switch.ambr @@ -5995,6 +5995,57 @@ 'state': 'on', }) # --- +# name: test_platform_setup_and_discovery[switch.inverter_pool_heat_pump_child_lock-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.inverter_pool_heat_pump_child_lock', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Child lock', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:account-lock', + 'original_name': 'Child lock', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'child_lock', + 'unique_id': 'tuya.zuqudhznfzttizpgbrnzchild_lock', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[switch.inverter_pool_heat_pump_child_lock-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Inverter Pool Heat Pump Child lock', + 'icon': 'mdi:account-lock', + }), + 'context': , + 'entity_id': 'switch.inverter_pool_heat_pump_child_lock', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_platform_setup_and_discovery[switch.inverter_pool_heat_pump_switch-entry] EntityRegistryEntrySnapshot({ 'aliases': list([