diff --git a/tests/components/tuya/fixtures/msp_unvgwjvxa1dgmzjz.json b/tests/components/tuya/fixtures/msp_unvgwjvxa1dgmzjz.json new file mode 100644 index 000000000000..5497869bd8c0 --- /dev/null +++ b/tests/components/tuya/fixtures/msp_unvgwjvxa1dgmzjz.json @@ -0,0 +1,247 @@ +{ + "endpoint": "https://apigw.tuyaeu.com", + "mqtt_connected": true, + "disabled_by": null, + "disabled_polling": false, + "name": "Smart Litter Box", + "category": "msp", + "product_id": "unvgwjvxa1dgmzjz", + "product_name": "Smart Litter Box", + "online": true, + "sub": false, + "time_zone": "+01:00", + "active_time": "2026-11-22T07:04:13+00:00", + "create_time": "2026-11-22T07:04:13+00:00", + "update_time": "2026-11-22T07:04:13+00:00", + "function": { + "start": { + "type": "Boolean", + "value": "{}" + }, + "auto_clean": { + "type": "Boolean", + "value": "{}" + }, + "delay_clean_time": { + "type": "Integer", + "value": "{\"unit\":\"s\",\"min\":20,\"max\":600,\"scale\":0,\"step\":5}" + }, + "sleep": { + "type": "Boolean", + "value": "{}" + }, + "sleep_start_time": { + "type": "Integer", + "value": "{\"unit\":\"\",\"min\":0,\"max\":1440,\"scale\":0,\"step\":1}" + }, + "sleep_end_time": { + "type": "Integer", + "value": "{\"unit\":\"\",\"min\":0,\"max\":1440,\"scale\":0,\"step\":1}" + }, + "uv": { + "type": "Boolean", + "value": "{}" + }, + "factory_reset": { + "type": "Boolean", + "value": "{}" + } + }, + "local_strategy": { + "3": { + "value_convert": "default", + "status_code": "start", + "config_item": { + "statusFormat": "{\"start\":\"$\"}", + "valueDesc": "{}", + "valueType": "Boolean", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + }, + "4": { + "value_convert": "default", + "status_code": "auto_clean", + "config_item": { + "statusFormat": "{\"auto_clean\":\"$\"}", + "valueDesc": "{}", + "valueType": "Boolean", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + }, + "5": { + "value_convert": "default", + "status_code": "delay_clean_time", + "config_item": { + "statusFormat": "{\"delay_clean_time\":\"$\"}", + "valueDesc": "{\"unit\":\"s\",\"min\":20,\"max\":600,\"scale\":0,\"step\":5}", + "valueType": "Integer", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + }, + "6": { + "value_convert": "default", + "status_code": "cat_weight", + "config_item": { + "statusFormat": "{\"cat_weight\":\"$\"}", + "valueDesc": "{\"unit\":\"g\",\"min\":0,\"max\":20000,\"scale\":0,\"step\":1}", + "valueType": "Integer", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + }, + "7": { + "value_convert": "default", + "status_code": "excretion_times_day", + "config_item": { + "statusFormat": "{\"excretion_times_day\":\"$\"}", + "valueDesc": "{\"unit\":\"times\",\"min\":0,\"max\":60,\"scale\":0,\"step\":1}", + "valueType": "Integer", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + }, + "8": { + "value_convert": "default", + "status_code": "excretion_time_day", + "config_item": { + "statusFormat": "{\"excretion_time_day\":\"$\"}", + "valueDesc": "{\"unit\":\"s\",\"min\":0,\"max\":600,\"scale\":0,\"step\":1}", + "valueType": "Integer", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + }, + "10": { + "value_convert": "default", + "status_code": "sleep", + "config_item": { + "statusFormat": "{\"sleep\":\"$\"}", + "valueDesc": "{}", + "valueType": "Boolean", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + }, + "11": { + "value_convert": "default", + "status_code": "sleep_start_time", + "config_item": { + "statusFormat": "{\"sleep_start_time\":\"$\"}", + "valueDesc": "{\"unit\":\"\",\"min\":0,\"max\":1440,\"scale\":0,\"step\":1}", + "valueType": "Integer", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + }, + "12": { + "value_convert": "default", + "status_code": "sleep_end_time", + "config_item": { + "statusFormat": "{\"sleep_end_time\":\"$\"}", + "valueDesc": "{\"unit\":\"\",\"min\":0,\"max\":1440,\"scale\":0,\"step\":1}", + "valueType": "Integer", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + }, + "13": { + "value_convert": "default", + "status_code": "uv", + "config_item": { + "statusFormat": "{\"uv\":\"$\"}", + "valueDesc": "{}", + "valueType": "Boolean", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + }, + "23": { + "value_convert": "default", + "status_code": "factory_reset", + "config_item": { + "statusFormat": "{\"factory_reset\":\"$\"}", + "valueDesc": "{}", + "valueType": "Boolean", + "enumMappingMap": {}, + "pid": "unvgwjvxa1dgmzjz" + } + } + }, + "status_range": { + "start": { + "type": "Boolean", + "value": "{}", + "report_type": null + }, + "auto_clean": { + "type": "Boolean", + "value": "{}", + "report_type": null + }, + "delay_clean_time": { + "type": "Integer", + "value": "{\"unit\":\"s\",\"min\":20,\"max\":600,\"scale\":0,\"step\":5}", + "report_type": null + }, + "cat_weight": { + "type": "Integer", + "value": "{\"unit\":\"g\",\"min\":0,\"max\":20000,\"scale\":0,\"step\":1}", + "report_type": null + }, + "excretion_times_day": { + "type": "Integer", + "value": "{\"unit\":\"times\",\"min\":0,\"max\":60,\"scale\":0,\"step\":1}", + "report_type": "sum" + }, + "excretion_time_day": { + "type": "Integer", + "value": "{\"unit\":\"s\",\"min\":0,\"max\":600,\"scale\":0,\"step\":1}", + "report_type": "un_known" + }, + "sleep": { + "type": "Boolean", + "value": "{}", + "report_type": null + }, + "sleep_start_time": { + "type": "Integer", + "value": "{\"unit\":\"\",\"min\":0,\"max\":1440,\"scale\":0,\"step\":1}", + "report_type": null + }, + "sleep_end_time": { + "type": "Integer", + "value": "{\"unit\":\"\",\"min\":0,\"max\":1440,\"scale\":0,\"step\":1}", + "report_type": null + }, + "uv": { + "type": "Boolean", + "value": "{}", + "report_type": null + }, + "factory_reset": { + "type": "Boolean", + "value": "{}", + "report_type": null + } + }, + "status": { + "start": false, + "auto_clean": true, + "delay_clean_time": 20, + "cat_weight": 0, + "excretion_times_day": 1, + "excretion_time_day": 0, + "sleep": false, + "sleep_start_time": 0, + "sleep_end_time": 0, + "uv": true, + "factory_reset": false + }, + "set_up": true, + "support_local": true, + "quirk": null, + "warnings": null +} diff --git a/tests/components/tuya/snapshots/test_button.ambr b/tests/components/tuya/snapshots/test_button.ambr index 35a764da6a5d..fdc410ad8500 100644 --- a/tests/components/tuya/snapshots/test_button.ambr +++ b/tests/components/tuya/snapshots/test_button.ambr @@ -403,6 +403,56 @@ 'state': 'unknown', }) # --- +# name: test_platform_setup_and_discovery[button.smart_litter_box_factory_reset-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': , + 'entity_id': 'button.smart_litter_box_factory_reset', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Factory reset', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Factory reset', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'factory_reset', + 'unique_id': 'tuya.zjzmgd1axvjwgvnupsmfactory_reset', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[button.smart_litter_box_factory_reset-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Smart Litter Box Factory reset', + }), + 'context': , + 'entity_id': 'button.smart_litter_box_factory_reset', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_platform_setup_and_discovery[button.v20_reset_duster_cloth-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/tuya/snapshots/test_init.ambr b/tests/components/tuya/snapshots/test_init.ambr index d357f2d53d4a..f325df126fbd 100644 --- a/tests/components/tuya/snapshots/test_init.ambr +++ b/tests/components/tuya/snapshots/test_init.ambr @@ -11199,6 +11199,36 @@ 'via_device_id': None, }) # --- +# name: test_device_registry[zjzmgd1axvjwgvnupsm] + DeviceRegistryEntrySnapshot({ + 'area_id': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'configuration_url': None, + 'connections': set({ + }), + 'disabled_by': None, + 'entry_type': None, + 'hw_version': None, + 'id': , + 'identifiers': set({ + tuple( + 'tuya', + 'zjzmgd1axvjwgvnupsm', + ), + }), + 'labels': set({ + }), + 'manufacturer': 'Tuya', + 'model': 'Smart Litter Box', + 'model_id': 'unvgwjvxa1dgmzjz', + 'name': 'Smart Litter Box', + 'name_by_user': None, + 'serial_number': None, + 'sw_version': None, + 'via_device_id': None, + }) +# --- # name: test_device_registry[zoytcemodrn39zqwrip] DeviceRegistryEntrySnapshot({ 'area_id': None, diff --git a/tests/components/tuya/snapshots/test_number.ambr b/tests/components/tuya/snapshots/test_number.ambr index 27a18b3fd57a..4aac874771d8 100644 --- a/tests/components/tuya/snapshots/test_number.ambr +++ b/tests/components/tuya/snapshots/test_number.ambr @@ -3324,6 +3324,67 @@ 'state': '10.0', }) # --- +# name: test_platform_setup_and_discovery[number.smart_litter_box_delay_clean_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : 600.0, + : 20.0, + : , + : 5.0, + }), + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.smart_litter_box_delay_clean_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Delay clean time', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Delay clean time', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'delay_clean_time', + 'unique_id': 'tuya.zjzmgd1axvjwgvnupsmdelay_clean_time', + 'unit_of_measurement': 's', + }) +# --- +# name: test_platform_setup_and_discovery[number.smart_litter_box_delay_clean_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'duration', + : 'Smart Litter Box Delay clean time', + : 600.0, + : 20.0, + : , + : 5.0, + : 's', + }), + 'context': , + 'entity_id': 'number.smart_litter_box_delay_clean_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '20.0', + }) +# --- # name: test_platform_setup_and_discovery[number.smart_thermostats_temperature_correction-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/tuya/snapshots/test_sensor.ambr b/tests/components/tuya/snapshots/test_sensor.ambr index 6f6bc31ae751..7077ac1be501 100644 --- a/tests/components/tuya/snapshots/test_sensor.ambr +++ b/tests/components/tuya/snapshots/test_sensor.ambr @@ -34169,6 +34169,176 @@ 'state': '24.0', }) # --- +# name: test_platform_setup_and_discovery[sensor.smart_litter_box_cat_weight-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.smart_litter_box_cat_weight', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Cat weight', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Cat weight', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'cat_weight', + 'unique_id': 'tuya.zjzmgd1axvjwgvnupsmcat_weight', + 'unit_of_measurement': 'g', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.smart_litter_box_cat_weight-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'weight', + : 'Smart Litter Box Cat weight', + : , + : 'g', + }), + 'context': , + 'entity_id': 'sensor.smart_litter_box_cat_weight', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.smart_litter_box_excretion_duration-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.smart_litter_box_excretion_duration', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Excretion duration', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Excretion duration', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'excretion_time_day', + 'unique_id': 'tuya.zjzmgd1axvjwgvnupsmexcretion_time_day', + 'unit_of_measurement': 's', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.smart_litter_box_excretion_duration-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'duration', + : 'Smart Litter Box Excretion duration', + : , + : 's', + }), + 'context': , + 'entity_id': 'sensor.smart_litter_box_excretion_duration', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.smart_litter_box_excretion_times_day-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.smart_litter_box_excretion_times_day', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Excretion times (day)', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Excretion times (day)', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'excretion_times_day', + 'unique_id': 'tuya.zjzmgd1axvjwgvnupsmexcretion_times_day', + 'unit_of_measurement': 'times', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.smart_litter_box_excretion_times_day-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Smart Litter Box Excretion times (day)', + : , + : 'times', + }), + 'context': , + 'entity_id': 'sensor.smart_litter_box_excretion_times_day', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0', + }) +# --- # name: test_platform_setup_and_discovery[sensor.smart_odor_eliminator_pro_battery-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/tuya/snapshots/test_switch.ambr b/tests/components/tuya/snapshots/test_switch.ambr index e6d05a074898..4b28ecdbb26c 100644 --- a/tests/components/tuya/snapshots/test_switch.ambr +++ b/tests/components/tuya/snapshots/test_switch.ambr @@ -11648,6 +11648,56 @@ 'state': 'off', }) # --- +# name: test_platform_setup_and_discovery[switch.smart_litter_box_auto_clean-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.smart_litter_box_auto_clean', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Auto clean', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Auto clean', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'auto_clean', + 'unique_id': 'tuya.zjzmgd1axvjwgvnupsmauto_clean', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[switch.smart_litter_box_auto_clean-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Smart Litter Box Auto clean', + }), + 'context': , + 'entity_id': 'switch.smart_litter_box_auto_clean', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- # name: test_platform_setup_and_discovery[switch.smart_odor_eliminator_pro_switch-entry] EntityRegistryEntrySnapshot({ 'aliases': list([