diff --git a/homeassistant/components/zha/button.py b/homeassistant/components/zha/button.py index 29bfb2ca248..0f98bfaad51 100644 --- a/homeassistant/components/zha/button.py +++ b/homeassistant/components/zha/button.py @@ -154,9 +154,21 @@ class ZHAAttributeButton(ZhaEntity, ButtonEntity): }, ) 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_value = 0 _attr_device_class = ButtonDeviceClass.RESTART _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 diff --git a/homeassistant/components/zha/core/channels/manufacturerspecific.py b/homeassistant/components/zha/core/channels/manufacturerspecific.py index 0c246e28db7..101db65a66e 100644 --- a/homeassistant/components/zha/core/channels/manufacturerspecific.py +++ b/homeassistant/components/zha/core/channels/manufacturerspecific.py @@ -71,6 +71,13 @@ class OppleRemote(ZigbeeChannel): "motion_sensitivity": 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: """Initialize channel specific.""" diff --git a/homeassistant/components/zha/select.py b/homeassistant/components/zha/select.py index 6d202ccceb2..79349273e38 100644 --- a/homeassistant/components/zha/select.py +++ b/homeassistant/components/zha/select.py @@ -225,9 +225,42 @@ class AqaraMotionSensitivities(types.enum8): 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"): """Representation of a ZHA on off transition time configuration entity.""" _select_attr = "motion_sensitivity" _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