Add "power outage memory" config entity to Xiaomi EU plugs to ZHA (#80444)

This commit is contained in:
TheJulianJES 2022-10-22 02:57:50 +02:00 committed by GitHub
parent f4f7122c66
commit 5eb69f38aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -62,7 +62,7 @@ class PhillipsRemote(ZigbeeChannel):
@registries.CHANNEL_ONLY_CLUSTERS.register(0xFCC0)
@registries.ZIGBEE_CHANNEL_REGISTRY.register(0xFCC0)
class OppleRemote(ZigbeeChannel):
"""Opple button channel."""
"""Opple channel."""
REPORT_CONFIG = ()
@ -82,6 +82,10 @@ class OppleRemote(ZigbeeChannel):
"motion_sensitivity": True,
"approach_distance": True,
}
elif self.cluster.endpoint.model in ("lumi.plug.mmeu01", "lumi.plug.maeu01"):
self.ZCL_INIT_ATTRS = {
"power_outage_memory": True,
}
async def async_initialize_channel_specific(self, from_cache: bool) -> None:
"""Initialize channel specific."""

View File

@ -293,6 +293,18 @@ class P1MotionTriggerIndicatorSwitch(
_attr_name = "LED trigger indicator"
@CONFIG_DIAGNOSTIC_MATCH(
channel_names="opple_cluster", models={"lumi.plug.mmeu01", "lumi.plug.maeu01"}
)
class XiaomiPlugPowerOutageMemorySwitch(
ZHASwitchConfigurationEntity, id_suffix="power_outage_memory"
):
"""Representation of a ZHA power outage memory configuration entity."""
_zcl_attribute: str = "power_outage_memory"
_attr_name = "Power outage memory"
@CONFIG_DIAGNOSTIC_MATCH(
channel_names="ikea_airpurifier",
models={"STARKVIND Air purifier", "STARKVIND Air purifier table"},