mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Add tuya snapshot tests for bladeless tower fan (#148401)
This commit is contained in:
parent
77ae6048ef
commit
8ccd097e98
@ -35,6 +35,12 @@ DEVICE_MOCKS = {
|
|||||||
Platform.SENSOR,
|
Platform.SENSOR,
|
||||||
Platform.SWITCH,
|
Platform.SWITCH,
|
||||||
],
|
],
|
||||||
|
"kj_bladeless_tower_fan": [
|
||||||
|
# https://github.com/orgs/home-assistant/discussions/61
|
||||||
|
Platform.FAN,
|
||||||
|
Platform.SELECT,
|
||||||
|
Platform.SWITCH,
|
||||||
|
],
|
||||||
"mcs_door_sensor": [
|
"mcs_door_sensor": [
|
||||||
# https://github.com/home-assistant/core/issues/108301
|
# https://github.com/home-assistant/core/issues/108301
|
||||||
Platform.BINARY_SENSOR,
|
Platform.BINARY_SENSOR,
|
||||||
|
79
tests/components/tuya/fixtures/kj_bladeless_tower_fan.json
Normal file
79
tests/components/tuya/fixtures/kj_bladeless_tower_fan.json
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"endpoint": "https://apigw.tuyaeu.com",
|
||||||
|
"terminal_id": "CENSORED",
|
||||||
|
"mqtt_connected": true,
|
||||||
|
"disabled_by": null,
|
||||||
|
"disabled_polling": false,
|
||||||
|
"id": "CENSORED",
|
||||||
|
"name": "Bree",
|
||||||
|
"category": "kj",
|
||||||
|
"product_id": "CENSORED",
|
||||||
|
"product_name": "40\" Bladeless Tower Fan",
|
||||||
|
"online": true,
|
||||||
|
"sub": false,
|
||||||
|
"time_zone": "+02:00",
|
||||||
|
"active_time": "2025-06-22T07:35:33+00:00",
|
||||||
|
"create_time": "2025-06-22T07:35:33+00:00",
|
||||||
|
"update_time": "2025-06-22T07:35:33+00:00",
|
||||||
|
"function": {
|
||||||
|
"switch": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"mode": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["sleep"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"countdown_set": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["cancel", "1h", "2h", "3h", "4h", "5h"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"status_range": {
|
||||||
|
"switch": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"mode": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["sleep"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"countdown_set": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["cancel", "1h", "2h", "3h", "4h", "5h"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"countdown_left": {
|
||||||
|
"type": "Integer",
|
||||||
|
"value": {
|
||||||
|
"unit": "min",
|
||||||
|
"min": 0,
|
||||||
|
"max": 1440,
|
||||||
|
"scale": 0,
|
||||||
|
"step": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fault": {
|
||||||
|
"type": "Bitmap",
|
||||||
|
"value": {
|
||||||
|
"label": ["E1", "E2"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"switch": false,
|
||||||
|
"mode": "normal",
|
||||||
|
"countdown_set": "cancel",
|
||||||
|
"countdown_left": 0,
|
||||||
|
"fault": 0
|
||||||
|
},
|
||||||
|
"set_up": true,
|
||||||
|
"support_local": true
|
||||||
|
}
|
@ -49,3 +49,60 @@
|
|||||||
'state': 'on',
|
'state': 'on',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_bladeless_tower_fan][fan.bree-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'preset_modes': list([
|
||||||
|
'sleep',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'fan',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'fan.bree',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': None,
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': <FanEntityFeature: 56>,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': 'tuya.CENSORED',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_bladeless_tower_fan][fan.bree-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'Bree',
|
||||||
|
'preset_mode': 'normal',
|
||||||
|
'preset_modes': list([
|
||||||
|
'sleep',
|
||||||
|
]),
|
||||||
|
'supported_features': <FanEntityFeature: 56>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'fan.bree',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'off',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
@ -60,6 +60,71 @@
|
|||||||
'state': 'cancel',
|
'state': 'cancel',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_bladeless_tower_fan][select.bree_countdown-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'options': list([
|
||||||
|
'cancel',
|
||||||
|
'1h',
|
||||||
|
'2h',
|
||||||
|
'3h',
|
||||||
|
'4h',
|
||||||
|
'5h',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'select',
|
||||||
|
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||||
|
'entity_id': 'select.bree_countdown',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Countdown',
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'countdown',
|
||||||
|
'unique_id': 'tuya.CENSOREDcountdown_set',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_bladeless_tower_fan][select.bree_countdown-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'Bree Countdown',
|
||||||
|
'options': list([
|
||||||
|
'cancel',
|
||||||
|
'1h',
|
||||||
|
'2h',
|
||||||
|
'3h',
|
||||||
|
'4h',
|
||||||
|
'5h',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'select.bree_countdown',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'cancel',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[tdq_4_443][select.4_433_power_on_behavior-entry]
|
# name: test_platform_setup_and_discovery[tdq_4_443][select.4_433_power_on_behavior-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
@ -386,6 +386,54 @@
|
|||||||
'state': 'on',
|
'state': 'on',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_bladeless_tower_fan][switch.bree_power-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.bree_power',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Power',
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'power',
|
||||||
|
'unique_id': 'tuya.CENSOREDswitch',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_bladeless_tower_fan][switch.bree_power-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'Bree Power',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'switch.bree_power',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'off',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[sfkzq_valve_controller][switch.sprinkler_cesare_switch-entry]
|
# name: test_platform_setup_and_discovery[sfkzq_valve_controller][switch.sprinkler_cesare_switch-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user