Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/components/tuya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
"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_t94pit6zjbask9qo", # https://github.com/home-assistant/core/pull/156781
"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
Expand Down
168 changes: 168 additions & 0 deletions tests/components/tuya/fixtures/wk_t94pit6zjbask9qo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"endpoint": "https://apigw.tuyaeu.com",
"mqtt_connected": true,
"disabled_by": null,
"disabled_polling": false,
"name": "Floor Thermostat Kitchen",
"category": "wk",
"product_id": "t94pit6zjbask9qo",
"product_name": "WiFi Knob Thermostat",
"online": true,
"sub": false,
"time_zone": "+03:00",
"active_time": "2025-10-07T08:19:14+00:00",
"create_time": "2025-10-07T08:19:14+00:00",
"update_time": "2025-10-07T08:19:14+00:00",
"function": {
"switch": {
"type": "Boolean",
"value": {}
},
"mode": {
"type": "Enum",
"value": { "range": ["auto", "manual", "off"] }
},
"temp_set": {
"type": "Integer",
"value": {
"unit": "\u2103",
"min": 50,
"max": 350,
"scale": 1,
"step": 10
}
},
"temp_set_f": {
"type": "Integer",
"value": {
"unit": "\u2109",
"min": 122,
"max": 662,
"scale": 1,
"step": 10
}
},
"temp_unit_convert": {
"type": "Enum",
"value": { "range": ["c", "f"] }
},
"work_days": {
"type": "Enum",
"value": { "range": ["5_2", "6_1", "7"] }
},
"factory_reset": {
"type": "Boolean",
"value": {}
},
"backlight": {
"type": "Integer",
"value": { "unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1 }
},
"sensor_choose": {
"type": "Enum",
"value": { "range": ["in", "out"] }
},
"child_lock": {
"type": "Boolean",
"value": {}
}
},
"status_range": {
"switch": {
"type": "Boolean",
"value": {}
},
"mode": {
"type": "Enum",
"value": { "range": ["auto", "manual", "off"] }
},
"temp_set": {
"type": "Integer",
"value": {
"unit": "\u2103",
"min": 50,
"max": 350,
"scale": 1,
"step": 10
}
},
"temp_set_f": {
"type": "Integer",
"value": {
"unit": "\u2109",
"min": 122,
"max": 662,
"scale": 1,
"step": 10
}
},
"temp_unit_convert": {
"type": "Enum",
"value": { "range": ["c", "f"] }
},
"temp_current": {
"type": "Integer",
"value": { "unit": "\u2103", "min": 0, "max": 50, "scale": 0, "step": 1 }
},
"humidity": {
"type": "Integer",
"value": { "unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1 }
},
"temp_current_f": {
"type": "Integer",
"value": {
"unit": "\u2109",
"min": -4,
"max": 122,
"scale": 0,
"step": 1
}
},
"work_days": {
"type": "Enum",
"value": { "range": ["5_2", "6_1", "7"] }
},
"work_state": {
"type": "Enum",
"value": { "range": ["opened", "closed"] }
},
"factory_reset": {
"type": "Boolean",
"value": {}
},
"backlight": {
"type": "Integer",
"value": { "unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1 }
},
"fault": {
"type": "Bitmap",
"value": { "label": ["e1", "e2", "e3"] }
},
"sensor_choose": {
"type": "Enum",
"value": { "range": ["in", "out"] }
},
"child_lock": {
"type": "Boolean",
"value": {}
}
},
"status": {
"switch": true,
"mode": "manual",
"temp_set": 23,
"temp_set_f": 41,
"temp_unit_convert": "c",
"temp_current": 20,
"humidity": 91,
"temp_current_f": -4,
"work_days": "5_2",
"work_state": "manual",
"factory_reset": false,
"backlight": 10,
"fault": 0,
"sensor_choose": "in"
},
"set_up": true,
"support_local": true
}
77 changes: 77 additions & 0 deletions tests/components/tuya/snapshots/test_climate.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,83 @@
'state': 'heat_cool',
})
# ---
# name: test_platform_setup_and_discovery[climate.floor_thermostat_kitchen-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': 35.0,
'min_temp': 5.0,
'preset_modes': list([
'off',
]),
'target_temp_step': 1.0,
}),
'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.floor_thermostat_kitchen',
'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: 401>,
'translation_key': None,
'unique_id': 'tuya.oq9ksabjz6tip49tkw',
'unit_of_measurement': None,
})
# ---
# name: test_platform_setup_and_discovery[climate.floor_thermostat_kitchen-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': 20.0,
'friendly_name': 'Floor Thermostat Kitchen',
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
]),
'max_temp': 35.0,
'min_temp': 5.0,
'preset_mode': None,
'preset_modes': list([
'off',
]),
'supported_features': <ClimateEntityFeature: 401>,
'target_temp_step': 1.0,
'temperature': 2.3,
}),
'context': <ANY>,
'entity_id': 'climate.floor_thermostat_kitchen',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'heat_cool',
})
# ---
# name: test_platform_setup_and_discovery[climate.geti_solar_pv_water_heater-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
Expand Down
31 changes: 31 additions & 0 deletions tests/components/tuya/snapshots/test_init.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -5610,6 +5610,37 @@
'via_device_id': None,
})
# ---
# name: test_device_registry[oq9ksabjz6tip49tkw]
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',
'oq9ksabjz6tip49tkw',
),
}),
'labels': set({
}),
'manufacturer': 'Tuya',
'model': 'WiFi Knob Thermostat',
'model_id': 't94pit6zjbask9qo',
'name': 'Floor Thermostat Kitchen',
'name_by_user': None,
'primary_config_entry': <ANY>,
'serial_number': None,
'sw_version': None,
'via_device_id': None,
})
# ---
# name: test_device_registry[oqyhsaqwsph]
DeviceRegistryEntrySnapshot({
'area_id': None,
Expand Down
48 changes: 48 additions & 0 deletions tests/components/tuya/snapshots/test_switch.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -3678,6 +3678,54 @@
'state': 'on',
})
# ---
# name: test_platform_setup_and_discovery[switch.floor_thermostat_kitchen_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.floor_thermostat_kitchen_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.oq9ksabjz6tip49tkwchild_lock',
'unit_of_measurement': None,
})
# ---
# name: test_platform_setup_and_discovery[switch.floor_thermostat_kitchen_child_lock-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Floor Thermostat Kitchen Child lock',
}),
'context': <ANY>,
'entity_id': 'switch.floor_thermostat_kitchen_child_lock',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_platform_setup_and_discovery[switch.framboisier_child_lock-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
Expand Down
Loading