Add config entities for lumi.motion.agl04 (#82087)

This commit is contained in:
David F. Mulcahey 2022-11-21 18:02:54 -05:00 committed by GitHub
parent aa443842b7
commit d47fe35a88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -110,6 +110,11 @@ class OppleRemote(ZigbeeChannel):
"motion_sensitivity": True, "motion_sensitivity": True,
"trigger_indicator": True, "trigger_indicator": True,
} }
elif self.cluster.endpoint.model == "lumi.motion.agl04":
self.ZCL_INIT_ATTRS = {
"detection_interval": True,
"motion_sensitivity": True,
}
elif self.cluster.endpoint.model == "lumi.motion.ac01": elif self.cluster.endpoint.model == "lumi.motion.ac01":
self.ZCL_INIT_ATTRS = { self.ZCL_INIT_ATTRS = {
"presence": True, "presence": True,
@ -124,7 +129,7 @@ class OppleRemote(ZigbeeChannel):
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."""
if self.cluster.endpoint.model == "lumi.motion.ac02": if self.cluster.endpoint.model in ("lumi.motion.ac02", "lumi.motion.agl04"):
interval = self.cluster.get("detection_interval", self.cluster.get(0x0102)) interval = self.cluster.get("detection_interval", self.cluster.get(0x0102))
if interval is not None: if interval is not None:
self.debug("Loaded detection interval at startup: %s", interval) self.debug("Loaded detection interval at startup: %s", interval)

View File

@ -448,7 +448,9 @@ class ZHANumberConfigurationEntity(ZhaEntity, NumberEntity):
_LOGGER.debug("read value=%s", value) _LOGGER.debug("read value=%s", value)
@CONFIG_DIAGNOSTIC_MATCH(channel_names="opple_cluster", models={"lumi.motion.ac02"}) @CONFIG_DIAGNOSTIC_MATCH(
channel_names="opple_cluster", models={"lumi.motion.ac02", "lumi.motion.agl04"}
)
class AqaraMotionDetectionInterval( class AqaraMotionDetectionInterval(
ZHANumberConfigurationEntity, id_suffix="detection_interval" ZHANumberConfigurationEntity, id_suffix="detection_interval"
): ):

View File

@ -336,7 +336,8 @@ class AqaraMotionSensitivities(types.enum8):
@CONFIG_DIAGNOSTIC_MATCH( @CONFIG_DIAGNOSTIC_MATCH(
channel_names="opple_cluster", models={"lumi.motion.ac01", "lumi.motion.ac02"} channel_names="opple_cluster",
models={"lumi.motion.ac01", "lumi.motion.ac02", "lumi.motion.agl04"},
) )
class AqaraMotionSensitivity(ZCLEnumSelectEntity, id_suffix="motion_sensitivity"): class AqaraMotionSensitivity(ZCLEnumSelectEntity, id_suffix="motion_sensitivity"):
"""Representation of a ZHA motion sensitivity configuration entity.""" """Representation of a ZHA motion sensitivity configuration entity."""