mirror of
https://github.com/home-assistant/core.git
synced 2025-09-12 08:11:38 +02:00
Add Tuya snapshots tests for ldcg category (luminance sensor) (#150169)
This commit is contained in:
@@ -282,6 +282,10 @@ DEVICE_MOCKS = {
|
|||||||
# https://github.com/home-assistant/core/pull/148646
|
# https://github.com/home-assistant/core/pull/148646
|
||||||
Platform.CLIMATE,
|
Platform.CLIMATE,
|
||||||
],
|
],
|
||||||
|
"ldcg_9kbbfeho": [
|
||||||
|
# https://github.com/orgs/home-assistant/discussions/482
|
||||||
|
Platform.SENSOR,
|
||||||
|
],
|
||||||
"mal_gyitctrjj1kefxp2": [
|
"mal_gyitctrjj1kefxp2": [
|
||||||
# Alarm Host support
|
# Alarm Host support
|
||||||
Platform.ALARM_CONTROL_PANEL,
|
Platform.ALARM_CONTROL_PANEL,
|
||||||
|
47
tests/components/tuya/fixtures/ldcg_9kbbfeho.json
Normal file
47
tests/components/tuya/fixtures/ldcg_9kbbfeho.json
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"endpoint": "https://apigw.tuyaeu.com",
|
||||||
|
"terminal_id": "REDACTED",
|
||||||
|
"mqtt_connected": true,
|
||||||
|
"disabled_by": null,
|
||||||
|
"disabled_polling": false,
|
||||||
|
"id": "bfbc8a692eaeeef455fkct",
|
||||||
|
"name": "Luminosité",
|
||||||
|
"category": "ldcg",
|
||||||
|
"product_id": "9kbbfeho",
|
||||||
|
"product_name": "Luminance sensor",
|
||||||
|
"online": true,
|
||||||
|
"sub": true,
|
||||||
|
"time_zone": "+02:00",
|
||||||
|
"active_time": "2025-07-25T16:37:21+00:00",
|
||||||
|
"create_time": "2025-07-25T16:37:21+00:00",
|
||||||
|
"update_time": "2025-07-25T16:37:21+00:00",
|
||||||
|
"function": {},
|
||||||
|
"status_range": {
|
||||||
|
"bright_value": {
|
||||||
|
"type": "Integer",
|
||||||
|
"value": {
|
||||||
|
"unit": "lux",
|
||||||
|
"min": 0,
|
||||||
|
"max": 1000,
|
||||||
|
"scale": 0,
|
||||||
|
"step": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"battery_percentage": {
|
||||||
|
"type": "Integer",
|
||||||
|
"value": {
|
||||||
|
"unit": "%",
|
||||||
|
"min": 0,
|
||||||
|
"max": 100,
|
||||||
|
"scale": 0,
|
||||||
|
"step": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"bright_value": 16,
|
||||||
|
"battery_percentage": 91
|
||||||
|
},
|
||||||
|
"set_up": true,
|
||||||
|
"support_local": true
|
||||||
|
}
|
@@ -1872,6 +1872,112 @@
|
|||||||
'state': '220.4',
|
'state': '220.4',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[ldcg_9kbbfeho][sensor.luminosite_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.luminosite_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.bfbc8a692eaeeef455fkctbattery_percentage',
|
||||||
|
'unit_of_measurement': '%',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[ldcg_9kbbfeho][sensor.luminosite_battery-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'battery',
|
||||||
|
'friendly_name': 'Luminosité Battery',
|
||||||
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||||
|
'unit_of_measurement': '%',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.luminosite_battery',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': '91.0',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[ldcg_9kbbfeho][sensor.luminosite_illuminance-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': None,
|
||||||
|
'entity_id': 'sensor.luminosite_illuminance',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.ILLUMINANCE: 'illuminance'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Illuminance',
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'illuminance',
|
||||||
|
'unique_id': 'tuya.bfbc8a692eaeeef455fkctbright_value',
|
||||||
|
'unit_of_measurement': 'lx',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[ldcg_9kbbfeho][sensor.luminosite_illuminance-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'illuminance',
|
||||||
|
'friendly_name': 'Luminosité Illuminance',
|
||||||
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||||
|
'unit_of_measurement': 'lx',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.luminosite_illuminance',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': '16.0',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[mcs_7jIGJAymiH8OsFFb][sensor.door_garage_battery-entry]
|
# name: test_platform_setup_and_discovery[mcs_7jIGJAymiH8OsFFb][sensor.door_garage_battery-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Reference in New Issue
Block a user