mirror of
https://github.com/home-assistant/core.git
synced 2025-09-12 00:01:43 +02:00
Add Tuya snapshots tests for sj category (rain sensor) (#150173)
This commit is contained in:
@@ -362,6 +362,11 @@ DEVICE_MOCKS = {
|
|||||||
Platform.SELECT,
|
Platform.SELECT,
|
||||||
Platform.SIREN,
|
Platform.SIREN,
|
||||||
],
|
],
|
||||||
|
"sj_tgvtvdoc": [
|
||||||
|
# https://github.com/orgs/home-assistant/discussions/482
|
||||||
|
Platform.BINARY_SENSOR,
|
||||||
|
Platform.SENSOR,
|
||||||
|
],
|
||||||
"sp_drezasavompxpcgm": [
|
"sp_drezasavompxpcgm": [
|
||||||
# https://github.com/home-assistant/core/issues/149704
|
# https://github.com/home-assistant/core/issues/149704
|
||||||
Platform.CAMERA,
|
Platform.CAMERA,
|
||||||
|
43
tests/components/tuya/fixtures/sj_tgvtvdoc.json
Normal file
43
tests/components/tuya/fixtures/sj_tgvtvdoc.json
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"endpoint": "https://apigw.tuyaeu.com",
|
||||||
|
"terminal_id": "REDACTED",
|
||||||
|
"mqtt_connected": true,
|
||||||
|
"disabled_by": null,
|
||||||
|
"disabled_polling": false,
|
||||||
|
"id": "bf58e095fd2d86d592tveh",
|
||||||
|
"name": "Tournesol",
|
||||||
|
"category": "sj",
|
||||||
|
"product_id": "tgvtvdoc",
|
||||||
|
"product_name": "Rain sensor",
|
||||||
|
"online": true,
|
||||||
|
"sub": true,
|
||||||
|
"time_zone": "+02:00",
|
||||||
|
"active_time": "2025-07-30T04:51:12+00:00",
|
||||||
|
"create_time": "2025-07-30T04:51:12+00:00",
|
||||||
|
"update_time": "2025-07-30T04:51:12+00:00",
|
||||||
|
"function": {},
|
||||||
|
"status_range": {
|
||||||
|
"watersensor_state": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["alarm", "normal"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"battery_percentage": {
|
||||||
|
"type": "Integer",
|
||||||
|
"value": {
|
||||||
|
"unit": "%",
|
||||||
|
"min": 0,
|
||||||
|
"max": 100,
|
||||||
|
"scale": 0,
|
||||||
|
"step": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"watersensor_state": "normal",
|
||||||
|
"battery_percentage": 98
|
||||||
|
},
|
||||||
|
"set_up": true,
|
||||||
|
"support_local": true
|
||||||
|
}
|
@@ -685,6 +685,55 @@
|
|||||||
'state': 'off',
|
'state': 'off',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[sj_tgvtvdoc][binary_sensor.tournesol_moisture-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': 'binary_sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'binary_sensor.tournesol_moisture',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <BinarySensorDeviceClass.MOISTURE: 'moisture'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Moisture',
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': 'tuya.bf58e095fd2d86d592tvehwatersensor_state',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[sj_tgvtvdoc][binary_sensor.tournesol_moisture-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'moisture',
|
||||||
|
'friendly_name': 'Tournesol Moisture',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.tournesol_moisture',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'off',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[wg2_nwxr8qcu4seltoro][binary_sensor.x5_zigbee_gateway_problem-entry]
|
# name: test_platform_setup_and_discovery[wg2_nwxr8qcu4seltoro][binary_sensor.x5_zigbee_gateway_problem-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
@@ -3879,6 +3879,59 @@
|
|||||||
'state': '1.0',
|
'state': '1.0',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[sj_tgvtvdoc][sensor.tournesol_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.tournesol_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.bf58e095fd2d86d592tvehbattery_percentage',
|
||||||
|
'unit_of_measurement': '%',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[sj_tgvtvdoc][sensor.tournesol_battery-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'battery',
|
||||||
|
'friendly_name': 'Tournesol Battery',
|
||||||
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||||
|
'unit_of_measurement': '%',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.tournesol_battery',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': '98.0',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][sensor.c9_battery-entry]
|
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][sensor.c9_battery-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Reference in New Issue
Block a user