diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 1ef18f4ea2b..79dc5c217b7 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -249,6 +249,7 @@ class DPCode(StrEnum): LIQUID_LEVEL_PERCENT = "liquid_level_percent" LIQUID_STATE = "liquid_state" LOCK = "lock" # Lock / Child lock + LOWER_TEMP = "lower_temp" MACH_OPERATE = "mach_operate" MANUAL_FEED = "manual_feed" MASTER_MODE = "master_mode" # alarm mode diff --git a/homeassistant/components/tuya/number.py b/homeassistant/components/tuya/number.py index 7fadaa0489b..4590b0451ec 100644 --- a/homeassistant/components/tuya/number.py +++ b/homeassistant/components/tuya/number.py @@ -398,6 +398,18 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = { translation_key="temp_correction", entity_category=EntityCategory.CONFIG, ), + NumberEntityDescription( + key=DPCode.LOWER_TEMP, + translation_key="lower_temperature", + device_class=NumberDeviceClass.TEMPERATURE, + entity_category=EntityCategory.CONFIG, + ), + NumberEntityDescription( + key=DPCode.UPPER_TEMP, + translation_key="upper_temperature", + device_class=NumberDeviceClass.TEMPERATURE, + entity_category=EntityCategory.CONFIG, + ), ), # Tank Level Sensor # Note: Undocumented diff --git a/homeassistant/components/tuya/strings.json b/homeassistant/components/tuya/strings.json index fa15e34694c..4adba067f28 100644 --- a/homeassistant/components/tuya/strings.json +++ b/homeassistant/components/tuya/strings.json @@ -231,6 +231,12 @@ }, "maximum_liquid_depth": { "name": "Maximum liquid depth" + }, + "lower_temperature": { + "name": "Lower temperature" + }, + "upper_temperature": { + "name": "Upper temperature" } }, "select": { diff --git a/tests/components/tuya/snapshots/test_number.ambr b/tests/components/tuya/snapshots/test_number.ambr index 1aa8c3dcca9..472b4e7c8d2 100644 --- a/tests/components/tuya/snapshots/test_number.ambr +++ b/tests/components/tuya/snapshots/test_number.ambr @@ -58,6 +58,65 @@ 'state': '1.0', }) # --- +# name: test_platform_setup_and_discovery[number.boiler_temperature_controller_lower_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 120.0, + 'min': -40.0, + 'mode': , + 'step': 0.1, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.boiler_temperature_controller_lower_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Lower temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'lower_temperature', + 'unique_id': 'tuya.zgiyrxflahjowpcckwlower_temp', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[number.boiler_temperature_controller_lower_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Boiler Temperature Controller Lower temperature', + 'max': 120.0, + 'min': -40.0, + 'mode': , + 'step': 0.1, + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'number.boiler_temperature_controller_lower_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '60.0', + }) +# --- # name: test_platform_setup_and_discovery[number.boiler_temperature_controller_temperature_correction-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -116,6 +175,65 @@ 'state': '-0.8', }) # --- +# name: test_platform_setup_and_discovery[number.boiler_temperature_controller_upper_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 120.0, + 'min': -40.0, + 'mode': , + 'step': 0.1, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.boiler_temperature_controller_upper_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Upper temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'upper_temperature', + 'unique_id': 'tuya.zgiyrxflahjowpcckwupper_temp', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[number.boiler_temperature_controller_upper_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Boiler Temperature Controller Upper temperature', + 'max': 120.0, + 'min': -40.0, + 'mode': , + 'step': 0.1, + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'number.boiler_temperature_controller_upper_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '58.5', + }) +# --- # name: test_platform_setup_and_discovery[number.c9_volume-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -1231,6 +1349,65 @@ 'state': '-2.0', }) # --- +# name: test_platform_setup_and_discovery[number.kabinet_upper_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 95.0, + 'min': 35.0, + 'mode': , + 'step': 0.5, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.kabinet_upper_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Upper temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'upper_temperature', + 'unique_id': 'tuya.dn7cjik6kwupper_temp', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[number.kabinet_upper_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Кабінет Upper temperature', + 'max': 95.0, + 'min': 35.0, + 'mode': , + 'step': 0.5, + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'number.kabinet_upper_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '45.0', + }) +# --- # name: test_platform_setup_and_discovery[number.multifunction_alarm_alarm_delay-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -1700,6 +1877,65 @@ 'state': '10.0', }) # --- +# name: test_platform_setup_and_discovery[number.smart_thermostats_lower_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 20.0, + 'min': 5.0, + 'mode': , + 'step': 1.0, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.smart_thermostats_lower_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Lower temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'lower_temperature', + 'unique_id': 'tuya.sb3zdertrw50bgogkwlower_temp', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[number.smart_thermostats_lower_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'smart thermostats Lower temperature', + 'max': 20.0, + 'min': 5.0, + 'mode': , + 'step': 1.0, + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'number.smart_thermostats_lower_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '5.0', + }) +# --- # name: test_platform_setup_and_discovery[number.smart_thermostats_temperature_correction-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -1758,6 +1994,65 @@ 'state': '-2.0', }) # --- +# name: test_platform_setup_and_discovery[number.smart_thermostats_upper_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 90.0, + 'min': 30.0, + 'mode': , + 'step': 1.0, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.smart_thermostats_upper_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Upper temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'upper_temperature', + 'unique_id': 'tuya.sb3zdertrw50bgogkwupper_temp', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[number.smart_thermostats_upper_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'smart thermostats Upper temperature', + 'max': 90.0, + 'min': 30.0, + 'mode': , + 'step': 1.0, + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'number.smart_thermostats_upper_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '30.0', + }) +# --- # name: test_platform_setup_and_discovery[number.sous_vide_cook_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -1932,6 +2227,65 @@ 'state': '95.0', }) # --- +# name: test_platform_setup_and_discovery[number.wifi_smart_gas_boiler_thermostat_lower_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 14.0, + 'min': 5.0, + 'mode': , + 'step': 0.5, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.wifi_smart_gas_boiler_thermostat_lower_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Lower temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'lower_temperature', + 'unique_id': 'tuya.j6mn1t4ut5end6ifkwlower_temp', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[number.wifi_smart_gas_boiler_thermostat_lower_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'WiFi Smart Gas Boiler Thermostat Lower temperature', + 'max': 14.0, + 'min': 5.0, + 'mode': , + 'step': 0.5, + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'number.wifi_smart_gas_boiler_thermostat_lower_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '5.0', + }) +# --- # name: test_platform_setup_and_discovery[number.wifi_smart_gas_boiler_thermostat_temperature_correction-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -1990,3 +2344,62 @@ 'state': '-1.5', }) # --- +# name: test_platform_setup_and_discovery[number.wifi_smart_gas_boiler_thermostat_upper_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 35.0, + 'min': 15.0, + 'mode': , + 'step': 0.5, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.wifi_smart_gas_boiler_thermostat_upper_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Upper temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'upper_temperature', + 'unique_id': 'tuya.j6mn1t4ut5end6ifkwupper_temp', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[number.wifi_smart_gas_boiler_thermostat_upper_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'WiFi Smart Gas Boiler Thermostat Upper temperature', + 'max': 35.0, + 'min': 15.0, + 'mode': , + 'step': 0.5, + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'number.wifi_smart_gas_boiler_thermostat_upper_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '35.0', + }) +# ---