1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-10 08:15:14 +01:00

Add new test fixture for Tuya wk category (#153457)

This commit is contained in:
epenet
2025-10-02 17:29:14 +02:00
committed by GitHub
parent 0e1d12b1ae
commit 7ab99c028c
6 changed files with 319 additions and 0 deletions
+1
View File
@@ -236,6 +236,7 @@ DEVICE_MOCKS = [
"wk_fi6dne5tu4t1nm6j", # https://github.com/orgs/home-assistant/discussions/243
"wk_gc1bxoq2hafxpa35", # https://github.com/home-assistant/core/issues/145551
"wk_gogb05wrtredz3bs", # https://github.com/home-assistant/core/issues/136337
"wk_tfbhw0mg", # https://github.com/home-assistant/core/issues/152282
"wk_y5obtqhuztqsf2mj", # https://github.com/home-assistant/core/issues/139735
"wkcz_gc4b1mdw7kebtuyz", # https://github.com/home-assistant/core/issues/135617
"wkf_9xfjixap", # https://github.com/home-assistant/core/issues/139966
@@ -0,0 +1,109 @@
{
"endpoint": "https://apigw.tuyaeu.com",
"mqtt_connected": true,
"disabled_by": null,
"disabled_polling": false,
"name": "Salon",
"category": "wk",
"product_id": "tfbhw0mg",
"product_name": "ZX-5442",
"online": true,
"sub": true,
"time_zone": "+02:00",
"active_time": "2025-09-13T13:48:55+00:00",
"create_time": "2025-09-13T13:48:55+00:00",
"update_time": "2025-09-13T13:48:55+00:00",
"function": {
"temp_set": {
"type": "Integer",
"value": {
"unit": "\u00b0C",
"min": 1,
"max": 59,
"scale": 1,
"step": 5
}
},
"mode": {
"type": "Enum",
"value": {
"range": ["auto", "manual", "holiday"]
}
},
"child_lock": {
"type": "Boolean",
"value": {}
},
"holiday_set": {
"type": "String",
"value": {
"maxlen": 255
}
}
},
"status_range": {
"temp_set": {
"type": "Integer",
"value": {
"unit": "\u00b0C",
"min": 1,
"max": 59,
"scale": 1,
"step": 5
}
},
"temp_current": {
"type": "Integer",
"value": {
"unit": "\u00b0C",
"min": -50,
"max": 350,
"scale": 1,
"step": 5
}
},
"mode": {
"type": "Enum",
"value": {
"range": ["auto", "manual", "holiday"]
}
},
"child_lock": {
"type": "Boolean",
"value": {}
},
"fault": {
"type": "Bitmap",
"value": {
"label": ["fault1", "fault2", "fault3"]
}
},
"battery_percentage": {
"type": "Integer",
"value": {
"unit": "V",
"min": 0,
"max": 1000,
"scale": 2,
"step": 1
}
},
"holiday_set": {
"type": "String",
"value": {
"maxlen": 255
}
}
},
"status": {
"temp_set": 59,
"temp_current": 203,
"mode": "manual",
"child_lock": false,
"fault": 0,
"battery_percentage": 117,
"holiday_set": "FAwZAAAiAAA="
},
"set_up": true,
"support_local": true
}
@@ -860,6 +860,83 @@
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[climate.salon-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
]),
'max_temp': 5.9,
'min_temp': 0.1,
'preset_modes': list([
'holiday',
]),
'target_temp_step': 0.5,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.salon',
'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': <ClimateEntityFeature: 17>,
'translation_key': None,
'unique_id': 'tuya.gm0whbftkw',
'unit_of_measurement': None,
})
# ---
# name: test_platform_setup_and_discovery[climate.salon-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': 20.3,
'friendly_name': 'Salon',
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
]),
'max_temp': 5.9,
'min_temp': 0.1,
'preset_mode': None,
'preset_modes': list([
'holiday',
]),
'supported_features': <ClimateEntityFeature: 17>,
'target_temp_step': 0.5,
'temperature': 5.9,
}),
'context': <ANY>,
'entity_id': 'climate.salon',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'heat_cool',
})
# ---
# name: test_platform_setup_and_discovery[climate.smart_thermostats-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@@ -3657,6 +3657,37 @@
'via_device_id': None,
})
# ---
# name: test_device_registry[gm0whbftkw]
DeviceRegistryEntrySnapshot({
'area_id': None,
'config_entries': <ANY>,
'config_entries_subentries': <ANY>,
'configuration_url': None,
'connections': set({
}),
'disabled_by': None,
'entry_type': None,
'hw_version': None,
'id': <ANY>,
'identifiers': set({
tuple(
'tuya',
'gm0whbftkw',
),
}),
'labels': set({
}),
'manufacturer': 'Tuya',
'model': 'ZX-5442',
'model_id': 'tfbhw0mg',
'name': 'Salon',
'name_by_user': None,
'primary_config_entry': <ANY>,
'serial_number': None,
'sw_version': None,
'via_device_id': None,
})
# ---
# name: test_device_registry[gnZOKztbAtcBkEGPzc]
DeviceRegistryEntrySnapshot({
'area_id': None,
@@ -15293,6 +15293,59 @@
'state': 'high',
})
# ---
# name: test_platform_setup_and_discovery[sensor.salon_battery-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.salon_battery',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <SensorDeviceClass.BATTERY: 'battery'>,
'original_icon': None,
'original_name': 'Battery',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'battery',
'unique_id': 'tuya.gm0whbftkwbattery_percentage',
'unit_of_measurement': '%',
})
# ---
# name: test_platform_setup_and_discovery[sensor.salon_battery-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery',
'friendly_name': 'Salon Battery',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.salon_battery',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '1.17',
})
# ---
# name: test_platform_setup_and_discovery[sensor.sapphire_current-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@@ -7016,6 +7016,54 @@
'state': 'on',
})
# ---
# name: test_platform_setup_and_discovery[switch.salon_child_lock-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': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.salon_child_lock',
'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': 'Child lock',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'child_lock',
'unique_id': 'tuya.gm0whbftkwchild_lock',
'unit_of_measurement': None,
})
# ---
# name: test_platform_setup_and_discovery[switch.salon_child_lock-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Salon Child lock',
}),
'context': <ANY>,
'entity_id': 'switch.salon_child_lock',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[switch.sapphire_socket-entry]
EntityRegistryEntrySnapshot({
'aliases': set({