Add Aqara FP1 configuration entities to ZHA (#73027)
* add multi state input * config entities * remove multistate input sensor used for testing * mypy
This commit is contained in:
parent
0e9164b082
commit
12c49e1c94
3 changed files with 54 additions and 2 deletions
|
@ -154,9 +154,21 @@ class ZHAAttributeButton(ZhaEntity, ButtonEntity):
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
class FrostLockResetButton(ZHAAttributeButton, id_suffix="reset_frost_lock"):
|
class FrostLockResetButton(ZHAAttributeButton, id_suffix="reset_frost_lock"):
|
||||||
"""Defines a ZHA identify button."""
|
"""Defines a ZHA frost lock reset button."""
|
||||||
|
|
||||||
_attribute_name = "frost_lock_reset"
|
_attribute_name = "frost_lock_reset"
|
||||||
_attribute_value = 0
|
_attribute_value = 0
|
||||||
_attr_device_class = ButtonDeviceClass.RESTART
|
_attr_device_class = ButtonDeviceClass.RESTART
|
||||||
_attr_entity_category = EntityCategory.CONFIG
|
_attr_entity_category = EntityCategory.CONFIG
|
||||||
|
|
||||||
|
|
||||||
|
@CONFIG_DIAGNOSTIC_MATCH(channel_names="opple_cluster", models={"lumi.motion.ac01"})
|
||||||
|
class NoPresenceStatusResetButton(
|
||||||
|
ZHAAttributeButton, id_suffix="reset_no_presence_status"
|
||||||
|
):
|
||||||
|
"""Defines a ZHA no presence status reset button."""
|
||||||
|
|
||||||
|
_attribute_name = "reset_no_presence_status"
|
||||||
|
_attribute_value = 1
|
||||||
|
_attr_device_class = ButtonDeviceClass.RESTART
|
||||||
|
_attr_entity_category = EntityCategory.CONFIG
|
||||||
|
|
|
@ -71,6 +71,13 @@ class OppleRemote(ZigbeeChannel):
|
||||||
"motion_sensitivity": True,
|
"motion_sensitivity": True,
|
||||||
"trigger_indicator": True,
|
"trigger_indicator": True,
|
||||||
}
|
}
|
||||||
|
elif self.cluster.endpoint.model == "lumi.motion.ac01":
|
||||||
|
self.ZCL_INIT_ATTRS = { # pylint: disable=invalid-name
|
||||||
|
"presence": True,
|
||||||
|
"monitoring_mode": True,
|
||||||
|
"motion_sensitivity": True,
|
||||||
|
"approach_distance": True,
|
||||||
|
}
|
||||||
|
|
||||||
async def async_initialize_channel_specific(self, from_cache: bool) -> None:
|
async def async_initialize_channel_specific(self, from_cache: bool) -> None:
|
||||||
"""Initialize channel specific."""
|
"""Initialize channel specific."""
|
||||||
|
|
|
@ -225,9 +225,42 @@ class AqaraMotionSensitivities(types.enum8):
|
||||||
High = 0x03
|
High = 0x03
|
||||||
|
|
||||||
|
|
||||||
@CONFIG_DIAGNOSTIC_MATCH(channel_names="opple_cluster", models={"lumi.motion.ac02"})
|
@CONFIG_DIAGNOSTIC_MATCH(
|
||||||
|
channel_names="opple_cluster", models={"lumi.motion.ac01", "lumi.motion.ac02"}
|
||||||
|
)
|
||||||
class AqaraMotionSensitivity(ZCLEnumSelectEntity, id_suffix="motion_sensitivity"):
|
class AqaraMotionSensitivity(ZCLEnumSelectEntity, id_suffix="motion_sensitivity"):
|
||||||
"""Representation of a ZHA on off transition time configuration entity."""
|
"""Representation of a ZHA on off transition time configuration entity."""
|
||||||
|
|
||||||
_select_attr = "motion_sensitivity"
|
_select_attr = "motion_sensitivity"
|
||||||
_enum = AqaraMotionSensitivities
|
_enum = AqaraMotionSensitivities
|
||||||
|
|
||||||
|
|
||||||
|
class AqaraMonitoringModess(types.enum8):
|
||||||
|
"""Aqara monitoring modes."""
|
||||||
|
|
||||||
|
Undirected = 0x00
|
||||||
|
Left_Right = 0x01
|
||||||
|
|
||||||
|
|
||||||
|
@CONFIG_DIAGNOSTIC_MATCH(channel_names="opple_cluster", models={"lumi.motion.ac01"})
|
||||||
|
class AqaraMonitoringMode(ZCLEnumSelectEntity, id_suffix="monitoring_mode"):
|
||||||
|
"""Representation of a ZHA monitoring mode configuration entity."""
|
||||||
|
|
||||||
|
_select_attr = "monitoring_mode"
|
||||||
|
_enum = AqaraMonitoringModess
|
||||||
|
|
||||||
|
|
||||||
|
class AqaraApproachDistances(types.enum8):
|
||||||
|
"""Aqara approach distances."""
|
||||||
|
|
||||||
|
Far = 0x00
|
||||||
|
Medium = 0x01
|
||||||
|
Near = 0x02
|
||||||
|
|
||||||
|
|
||||||
|
@CONFIG_DIAGNOSTIC_MATCH(channel_names="opple_cluster", models={"lumi.motion.ac01"})
|
||||||
|
class AqaraApproachDistance(ZCLEnumSelectEntity, id_suffix="approach_distance"):
|
||||||
|
"""Representation of a ZHA approach distance configuration entity."""
|
||||||
|
|
||||||
|
_select_attr = "approach_distance"
|
||||||
|
_enum = AqaraApproachDistances
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue