Add Matter occupancy sensing hold time (#150745)

This commit is contained in:
Ludovic BOUÉ
2025-09-01 15:14:08 +02:00
committed by GitHub
parent 3abf91af3a
commit ad154dce40
8 changed files with 746 additions and 3 deletions
+16 -1
View File
@@ -302,7 +302,7 @@ DISCOVERY_SCHEMAS = [
entity_description=MatterNumberEntityDescription(
key="PIROccupiedToUnoccupiedDelay",
entity_category=EntityCategory.CONFIG,
translation_key="pir_occupied_to_unoccupied_delay",
translation_key="hold_time", # pir_occupied_to_unoccupied_delay for old revisions
native_max_value=65534,
native_min_value=0,
native_unit_of_measurement=UnitOfTime.SECONDS,
@@ -312,6 +312,21 @@ DISCOVERY_SCHEMAS = [
required_attributes=(
clusters.OccupancySensing.Attributes.PIROccupiedToUnoccupiedDelay,
),
absent_attributes=(clusters.OccupancySensing.Attributes.HoldTime,),
),
MatterDiscoverySchema(
platform=Platform.NUMBER,
entity_description=MatterNumberEntityDescription(
key="OccupancySensingHoldTime",
entity_category=EntityCategory.CONFIG,
translation_key="hold_time",
native_max_value=65534,
native_min_value=1,
native_unit_of_measurement=UnitOfTime.SECONDS,
mode=NumberMode.BOX,
),
entity_class=MatterNumber,
required_attributes=(clusters.OccupancySensing.Attributes.HoldTime,),
),
MatterDiscoverySchema(
platform=Platform.NUMBER,
+2 -2
View File
@@ -204,8 +204,8 @@
"temperature_setpoint": {
"name": "Temperature setpoint"
},
"pir_occupied_to_unoccupied_delay": {
"name": "Occupied to unoccupied delay"
"hold_time": {
"name": "Hold time"
},
"auto_relock_timer": {
"name": "Autorelock time"
+1
View File
@@ -77,6 +77,7 @@ async def integration_fixture(
"air_purifier",
"air_quality_sensor",
"aqara_door_window_p2",
"aqara_motion_p2",
"battery_storage",
"color_temperature_light",
"cooktop",
@@ -0,0 +1,309 @@
{
"node_id": 83,
"date_commissioned": "2025-08-09T16:22:00.289575",
"last_interview": "2025-08-25T07:17:44.834405",
"interview_version": 6,
"available": true,
"is_bridge": false,
"attributes": {
"0/29/0": [
{
"0": 18,
"1": 1
},
{
"0": 22,
"1": 1
}
],
"0/29/1": [29, 31, 40, 42, 48, 49, 51, 60, 62, 63, 70],
"0/29/2": [41],
"0/29/3": [1, 2, 3],
"0/29/65532": 0,
"0/29/65533": 2,
"0/29/65528": [],
"0/29/65529": [],
"0/29/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533],
"0/31/0": [
{
"1": 5,
"2": 2,
"3": [112233],
"4": null,
"254": 3
}
],
"0/31/1": [],
"0/31/2": 4,
"0/31/3": 3,
"0/31/4": 4,
"0/31/65532": 0,
"0/31/65533": 2,
"0/31/65528": [],
"0/31/65529": [],
"0/31/65531": [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533],
"0/40/0": 18,
"0/40/1": "Aqara",
"0/40/2": 4447,
"0/40/3": "Aqara Motion and Light Sensor P2",
"0/40/4": 8195,
"0/40/5": "",
"0/40/6": "**REDACTED**",
"0/40/7": 1000,
"0/40/8": "1.0.0.0",
"0/40/9": 1031,
"0/40/10": "1.0.3.1",
"0/40/11": "20240201",
"0/40/12": "AS057",
"0/40/13": "https://www.aqara.com/en/products.html",
"0/40/14": "Aqara Motion and Light Sensor P2",
"0/40/15": "18C23C2F3F08",
"0/40/16": false,
"0/40/18": "47937B9DA39E1189",
"0/40/19": {
"0": 3,
"1": 3
},
"0/40/21": 17039616,
"0/40/22": 1,
"0/40/65532": 0,
"0/40/65533": 4,
"0/40/65528": [],
"0/40/65529": [],
"0/40/65531": [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 22,
65528, 65529, 65531, 65532, 65533
],
"0/42/0": [],
"0/42/1": true,
"0/42/2": 1,
"0/42/3": null,
"0/42/65532": 0,
"0/42/65533": 1,
"0/42/65528": [],
"0/42/65529": [0],
"0/42/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533],
"0/48/0": 0,
"0/48/1": {
"0": 60,
"1": 900
},
"0/48/2": 0,
"0/48/3": 0,
"0/48/4": true,
"0/48/65532": 0,
"0/48/65533": 2,
"0/48/65528": [1, 3, 5],
"0/48/65529": [0, 2, 4],
"0/48/65531": [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533],
"0/49/0": 1,
"0/49/1": [
{
"0": "p0jbsOzJRNw=",
"1": true
}
],
"0/49/2": 10,
"0/49/3": 20,
"0/49/4": true,
"0/49/5": 0,
"0/49/6": "p0jbsOzJRNw=",
"0/49/7": null,
"0/49/9": 4,
"0/49/10": 4,
"0/49/65532": 2,
"0/49/65533": 2,
"0/49/65528": [1, 5, 7],
"0/49/65529": [0, 3, 4, 6, 8],
"0/49/65531": [
0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 65528, 65529, 65531, 65532, 65533
],
"0/51/0": [
{
"0": "MyHome",
"1": true,
"2": null,
"3": null,
"4": "YmXZYp+mnAg=",
"5": [],
"6": [
"/QANuACgAAAAAAD//gBgAQ==",
"/U8h7+VkAAByQ/pRGsN9gg==",
"/QANuACgBEACp5kHYJuFWzA==",
"/oAAAAAAAABgZdlin6acCA=="
],
"7": 4
}
],
"0/51/1": 1,
"0/51/2": 14088,
"0/51/4": 5,
"0/51/8": false,
"0/51/65532": 0,
"0/51/65533": 2,
"0/51/65528": [2],
"0/51/65529": [0, 1],
"0/51/65531": [0, 1, 2, 4, 8, 65528, 65529, 65531, 65532, 65533],
"0/60/0": 0,
"0/60/1": null,
"0/60/2": null,
"0/60/65532": 1,
"0/60/65533": 1,
"0/60/65528": [],
"0/60/65529": [0, 1, 2],
"0/60/65531": [0, 1, 2, 65528, 65529, 65531, 65532, 65533],
"0/62/0": [
{
"1": "FTABAQEkAgE3AyQTAhgmBIAigScmBYAlTTo3BiQVAiQRUxgkBwEkCAEwCUEEavB0X/e5zUwbpO9fZAN2FO4U+PXk6rhtGmcKcTHz6GQ0pbzcEwae2oDap6Ya9/UdMR5sgu5+DmFO3lY/lNcpKzcKNQEoARgkAgE2AwQCBAEYMAQUIMN8SBj14ODdZCWLAXSM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/63/65532": 0,
"0/63/65533": 2,
"0/63/65528": [2, 5],
"0/63/65529": [0, 1, 3, 4],
"0/63/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533],
"0/70/0": 600,
"0/70/1": 10000,
"0/70/2": 5000,
"0/70/65532": 0,
"0/70/65533": 3,
"0/70/65528": [],
"0/70/65529": [],
"0/70/65531": [0, 1, 2, 65528, 65529, 65531, 65532, 65533],
"1/3/0": 0,
"1/3/1": 2,
"1/3/65532": 0,
"1/3/65533": 5,
"1/3/65528": [],
"1/3/65529": [0, 64],
"1/3/65531": [0, 1, 65528, 65529, 65531, 65532, 65533],
"1/29/0": [
{
"0": 263,
"1": 1
}
],
"1/29/1": [3, 29, 128, 1030],
"1/29/2": [],
"1/29/3": [],
"1/29/65532": 0,
"1/29/65533": 2,
"1/29/65528": [],
"1/29/65529": [],
"1/29/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533],
"1/128/0": 1,
"1/128/1": 3,
"1/128/2": 1,
"1/128/65532": 8,
"1/128/65533": 1,
"1/128/65528": [],
"1/128/65529": [],
"1/128/65531": [0, 1, 2, 65528, 65529, 65531, 65532, 65533],
"1/1030/0": 0,
"1/1030/1": 0,
"1/1030/2": 1,
"1/1030/3": 30,
"1/1030/4": {
"0": 5,
"1": 300,
"2": 30
},
"1/1030/65532": 2,
"1/1030/65533": 5,
"1/1030/65528": [],
"1/1030/65529": [],
"1/1030/65531": [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533],
"2/3/0": 0,
"2/3/1": 2,
"2/3/65532": 0,
"2/3/65533": 5,
"2/3/65528": [],
"2/3/65529": [0, 64],
"2/3/65531": [0, 1, 65528, 65529, 65531, 65532, 65533],
"2/29/0": [
{
"0": 262,
"1": 1
}
],
"2/29/1": [3, 29, 1024],
"2/29/2": [],
"2/29/3": [],
"2/29/65532": 0,
"2/29/65533": 2,
"2/29/65528": [],
"2/29/65529": [],
"2/29/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533],
"2/1024/0": 15683,
"2/1024/1": 1,
"2/1024/2": 31761,
"2/1024/65532": 0,
"2/1024/65533": 3,
"2/1024/65528": [],
"2/1024/65529": [],
"2/1024/65531": [0, 1, 2, 65528, 65529, 65531, 65532, 65533],
"3/29/0": [
{
"0": 17,
"1": 1
}
],
"3/29/1": [29, 47],
"3/29/2": [],
"3/29/3": [],
"3/29/65532": 0,
"3/29/65533": 2,
"3/29/65528": [],
"3/29/65529": [],
"3/29/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533],
"3/47/0": 1,
"3/47/1": 0,
"3/47/2": "Battery",
"3/47/11": 2904,
"3/47/12": 100,
"3/47/14": 0,
"3/47/15": false,
"3/47/16": 2,
"3/47/19": "CR2450",
"3/47/25": 2,
"3/47/31": [],
"3/47/65532": 10,
"3/47/65533": 3,
"3/47/65528": [],
"3/47/65529": [],
"3/47/65531": [
0, 1, 2, 11, 12, 14, 15, 16, 19, 25, 31, 65528, 65529, 65531, 65532, 65533
]
},
"attribute_subscriptions": []
}
@@ -48,6 +48,55 @@
'state': 'off',
})
# ---
# name: test_binary_sensors[aqara_motion_p2][binary_sensor.aqara_motion_and_light_sensor_p2_occupancy-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.aqara_motion_and_light_sensor_p2_occupancy',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.OCCUPANCY: 'occupancy'>,
'original_icon': None,
'original_name': 'Occupancy',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '00000000000004D2-0000000000000053-MatterNodeDevice-1-OccupancySensor-1030-0',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[aqara_motion_p2][binary_sensor.aqara_motion_and_light_sensor_p2_occupancy-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'occupancy',
'friendly_name': 'Aqara Motion and Light Sensor P2 Occupancy',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.aqara_motion_and_light_sensor_p2_occupancy',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensors[door_lock][binary_sensor.mock_door_lock_battery-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@@ -144,6 +144,104 @@
'state': 'unknown',
})
# ---
# name: test_buttons[aqara_motion_p2][button.aqara_motion_and_light_sensor_p2_identify_1-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': 'button',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'button.aqara_motion_and_light_sensor_p2_identify_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <ButtonDeviceClass.IDENTIFY: 'identify'>,
'original_icon': None,
'original_name': 'Identify (1)',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '00000000000004D2-0000000000000053-MatterNodeDevice-1-IdentifyButton-3-1',
'unit_of_measurement': None,
})
# ---
# name: test_buttons[aqara_motion_p2][button.aqara_motion_and_light_sensor_p2_identify_1-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'identify',
'friendly_name': 'Aqara Motion and Light Sensor P2 Identify (1)',
}),
'context': <ANY>,
'entity_id': 'button.aqara_motion_and_light_sensor_p2_identify_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_buttons[aqara_motion_p2][button.aqara_motion_and_light_sensor_p2_identify_2-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': 'button',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'button.aqara_motion_and_light_sensor_p2_identify_2',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <ButtonDeviceClass.IDENTIFY: 'identify'>,
'original_icon': None,
'original_name': 'Identify (2)',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '00000000000004D2-0000000000000053-MatterNodeDevice-2-IdentifyButton-3-1',
'unit_of_measurement': None,
})
# ---
# name: test_buttons[aqara_motion_p2][button.aqara_motion_and_light_sensor_p2_identify_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'identify',
'friendly_name': 'Aqara Motion and Light Sensor P2 Identify (2)',
}),
'context': <ANY>,
'entity_id': 'button.aqara_motion_and_light_sensor_p2_identify_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_buttons[color_temperature_light][button.mock_color_temperature_light_identify-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@@ -1,4 +1,62 @@
# serializer version: 1
# name: test_numbers[aqara_motion_p2][number.aqara_motion_and_light_sensor_p2_hold_time-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 65534,
'min': 1,
'mode': <NumberMode.BOX: 'box'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.aqara_motion_and_light_sensor_p2_hold_time',
'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': 'Hold time',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'hold_time',
'unique_id': '00000000000004D2-0000000000000053-MatterNodeDevice-1-OccupancySensingHoldTime-1030-3',
'unit_of_measurement': <UnitOfTime.SECONDS: 's'>,
})
# ---
# name: test_numbers[aqara_motion_p2][number.aqara_motion_and_light_sensor_p2_hold_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Aqara Motion and Light Sensor P2 Hold time',
'max': 65534,
'min': 1,
'mode': <NumberMode.BOX: 'box'>,
'step': 1.0,
'unit_of_measurement': <UnitOfTime.SECONDS: 's'>,
}),
'context': <ANY>,
'entity_id': 'number.aqara_motion_and_light_sensor_p2_hold_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '30',
})
# ---
# name: test_numbers[color_temperature_light][number.mock_color_temperature_light_on_level-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@@ -1411,6 +1411,219 @@
'state': '3.01',
})
# ---
# name: test_sensors[aqara_motion_p2][sensor.aqara_motion_and_light_sensor_p2_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.aqara_motion_and_light_sensor_p2_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': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '00000000000004D2-0000000000000053-MatterNodeDevice-3-PowerSource-47-12',
'unit_of_measurement': '%',
})
# ---
# name: test_sensors[aqara_motion_p2][sensor.aqara_motion_and_light_sensor_p2_battery-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery',
'friendly_name': 'Aqara Motion and Light Sensor P2 Battery',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.aqara_motion_and_light_sensor_p2_battery',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '50',
})
# ---
# name: test_sensors[aqara_motion_p2][sensor.aqara_motion_and_light_sensor_p2_battery_type-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': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.aqara_motion_and_light_sensor_p2_battery_type',
'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': 'Battery type',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'battery_replacement_description',
'unique_id': '00000000000004D2-0000000000000053-MatterNodeDevice-3-PowerSourceBatReplacementDescription-47-19',
'unit_of_measurement': None,
})
# ---
# name: test_sensors[aqara_motion_p2][sensor.aqara_motion_and_light_sensor_p2_battery_type-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Aqara Motion and Light Sensor P2 Battery type',
}),
'context': <ANY>,
'entity_id': 'sensor.aqara_motion_and_light_sensor_p2_battery_type',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'CR2450',
})
# ---
# name: test_sensors[aqara_motion_p2][sensor.aqara_motion_and_light_sensor_p2_battery_voltage-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.aqara_motion_and_light_sensor_p2_battery_voltage',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
'sensor': dict({
'suggested_display_precision': 0,
}),
'sensor.private': dict({
'suggested_unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
}),
}),
'original_device_class': <SensorDeviceClass.VOLTAGE: 'voltage'>,
'original_icon': None,
'original_name': 'Battery voltage',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'battery_voltage',
'unique_id': '00000000000004D2-0000000000000053-MatterNodeDevice-3-PowerSourceBatVoltage-47-11',
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
})
# ---
# name: test_sensors[aqara_motion_p2][sensor.aqara_motion_and_light_sensor_p2_battery_voltage-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'voltage',
'friendly_name': 'Aqara Motion and Light Sensor P2 Battery voltage',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
}),
'context': <ANY>,
'entity_id': 'sensor.aqara_motion_and_light_sensor_p2_battery_voltage',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '2.904',
})
# ---
# name: test_sensors[aqara_motion_p2][sensor.aqara_motion_and_light_sensor_p2_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.aqara_motion_and_light_sensor_p2_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': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '00000000000004D2-0000000000000053-MatterNodeDevice-2-LightSensor-1024-0',
'unit_of_measurement': 'lx',
})
# ---
# name: test_sensors[aqara_motion_p2][sensor.aqara_motion_and_light_sensor_p2_illuminance-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'illuminance',
'friendly_name': 'Aqara Motion and Light Sensor P2 Illuminance',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': 'lx',
}),
'context': <ANY>,
'entity_id': 'sensor.aqara_motion_and_light_sensor_p2_illuminance',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '37.0',
})
# ---
# name: test_sensors[battery_storage][sensor.mock_battery_storage_active_current-entry]
EntityRegistryEntrySnapshot({
'aliases': set({