mirror of
https://github.com/home-assistant/core.git
synced 2025-09-09 14:51:34 +02:00
Matter SensitivityLevel
for Aqara Door and Window Sensor P2 (#151117)
This commit is contained in:
@@ -502,4 +502,29 @@ DISCOVERY_SCHEMAS = [
|
|||||||
clusters.PumpConfigurationAndControl.Attributes.OperationMode,
|
clusters.PumpConfigurationAndControl.Attributes.OperationMode,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
MatterDiscoverySchema(
|
||||||
|
platform=Platform.SELECT,
|
||||||
|
entity_description=MatterSelectEntityDescription(
|
||||||
|
key="AqaraBooleanStateConfigurationCurrentSensitivityLevel",
|
||||||
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
translation_key="sensitivity_level",
|
||||||
|
options=["10 mm", "20 mm", "30 mm"],
|
||||||
|
device_to_ha={
|
||||||
|
0: "10 mm", # 10 mm => CurrentSensitivityLevel=0 / highest sensitivity level
|
||||||
|
1: "20 mm", # 20 mm => CurrentSensitivityLevel=1 / medium sensitivity level
|
||||||
|
2: "30 mm", # 30 mm => CurrentSensitivityLevel=2 / lowest sensitivity level
|
||||||
|
}.get,
|
||||||
|
ha_to_device={
|
||||||
|
"10 mm": 0,
|
||||||
|
"20 mm": 1,
|
||||||
|
"30 mm": 2,
|
||||||
|
}.get,
|
||||||
|
),
|
||||||
|
entity_class=MatterAttributeSelectEntity,
|
||||||
|
required_attributes=(
|
||||||
|
clusters.BooleanStateConfiguration.Attributes.CurrentSensitivityLevel,
|
||||||
|
),
|
||||||
|
vendor_id=(4447,),
|
||||||
|
product_name=("Aqara Door and Window Sensor P2",),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user