Add model check to ZHA Sonoff manufacturer specific cluster handler (#108947)

This commit is contained in:
David F. Mulcahey 2024-01-27 10:40:23 -05:00 committed by GitHub
parent 3cc5ffaa4b
commit 7069fb9508
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -430,4 +430,8 @@ class XiaomiVibrationAQ1ClusterHandler(MultistateInputClusterHandler):
class SonoffPresenceSenorClusterHandler(ClusterHandler):
"""SonoffPresenceSensor cluster handler."""
ZCL_INIT_ATTRS = {"last_illumination_state": True}
def __init__(self, cluster: zigpy.zcl.Cluster, endpoint: Endpoint) -> None:
"""Initialize SonoffPresenceSensor cluster handler."""
super().__init__(cluster, endpoint)
if self.cluster.endpoint.model == "SNZB-06P":
self.ZCL_INIT_ATTRS = {"last_illumination_state": True}