mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Add tuya snapshot tests for kg category (#148492)
This commit is contained in:
parent
59fe6da47c
commit
511ffdc03c
@ -40,6 +40,10 @@ DEVICE_MOCKS = {
|
|||||||
Platform.SENSOR,
|
Platform.SENSOR,
|
||||||
Platform.SWITCH,
|
Platform.SWITCH,
|
||||||
],
|
],
|
||||||
|
"kg_smart_valve": [
|
||||||
|
# https://github.com/home-assistant/core/issues/148347
|
||||||
|
Platform.SWITCH,
|
||||||
|
],
|
||||||
"kj_bladeless_tower_fan": [
|
"kj_bladeless_tower_fan": [
|
||||||
# https://github.com/orgs/home-assistant/discussions/61
|
# https://github.com/orgs/home-assistant/discussions/61
|
||||||
Platform.FAN,
|
Platform.FAN,
|
||||||
|
56
tests/components/tuya/fixtures/kg_smart_valve.json
Normal file
56
tests/components/tuya/fixtures/kg_smart_valve.json
Normal file
@ -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
|
||||||
|
}
|
@ -386,6 +386,55 @@
|
|||||||
'state': 'on',
|
'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': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'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': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <SwitchDeviceClass.OUTLET: 'outlet'>,
|
||||||
|
'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': <ANY>,
|
||||||
|
'entity_id': 'switch.qt_switch_switch_1',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unavailable',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[kj_bladeless_tower_fan][switch.bree_power-entry]
|
# name: test_platform_setup_and_discovery[kj_bladeless_tower_fan][switch.bree_power-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user