diff --git a/tests/components/tuya/__init__.py b/tests/components/tuya/__init__.py index cc14003bcf5..b308df7e2f9 100644 --- a/tests/components/tuya/__init__.py +++ b/tests/components/tuya/__init__.py @@ -40,6 +40,10 @@ DEVICE_MOCKS = { Platform.SENSOR, Platform.SWITCH, ], + "kg_smart_valve": [ + # https://github.com/home-assistant/core/issues/148347 + Platform.SWITCH, + ], "kj_bladeless_tower_fan": [ # https://github.com/orgs/home-assistant/discussions/61 Platform.FAN, diff --git a/tests/components/tuya/fixtures/kg_smart_valve.json b/tests/components/tuya/fixtures/kg_smart_valve.json new file mode 100644 index 00000000000..63d9148afbf --- /dev/null +++ b/tests/components/tuya/fixtures/kg_smart_valve.json @@ -0,0 +1,56 @@ +{ + "endpoint": "https://apigw.tuyaus.com", + "terminal_id": "1750526976566fMhqJs", + "mqtt_connected": true, + "disabled_by": null, + "disabled_polling": true, + "id": "0665305284f3ebe9fdc1", + "name": "QT-Switch", + "category": "kg", + "product_id": "gbm9ata1zrzaez4a", + "product_name": "Smart Valve", + "online": false, + "sub": false, + "time_zone": "-05:00", + "active_time": "2020-01-27T23:37:47+00:00", + "create_time": "2020-01-27T23:37:47+00:00", + "update_time": "2020-01-27T23:37:47+00:00", + "function": { + "switch_1": { + "type": "Boolean", + "value": {} + }, + "countdown_1": { + "type": "Integer", + "value": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + } + }, + "status_range": { + "switch_1": { + "type": "Boolean", + "value": {} + }, + "countdown_1": { + "type": "Integer", + "value": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + } + }, + "status": { + "switch_1": false, + "countdown_1": 0 + }, + "set_up": true, + "support_local": true +} diff --git a/tests/components/tuya/snapshots/test_switch.ambr b/tests/components/tuya/snapshots/test_switch.ambr index c4e813ddfdc..0f042cbce52 100644 --- a/tests/components/tuya/snapshots/test_switch.ambr +++ b/tests/components/tuya/snapshots/test_switch.ambr @@ -386,6 +386,55 @@ 'state': 'on', }) # --- +# name: test_platform_setup_and_discovery[kg_smart_valve][switch.qt_switch_switch_1-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.qt_switch_switch_1', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Switch 1', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'switch_1', + 'unique_id': 'tuya.0665305284f3ebe9fdc1switch_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[kg_smart_valve][switch.qt_switch_switch_1-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'outlet', + 'friendly_name': 'QT-Switch Switch 1', + }), + 'context': , + 'entity_id': 'switch.qt_switch_switch_1', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- # name: test_platform_setup_and_discovery[kj_bladeless_tower_fan][switch.bree_power-entry] EntityRegistryEntrySnapshot({ 'aliases': set({