Fix ZHA covering mode for Aqara E1 curtain driver not initialized (#102749)
This commit is contained in:
parent
8c99cf14d3
commit
c047f47595
1 changed files with 15 additions and 1 deletions
|
@ -1,6 +1,9 @@
|
|||
"""Closures cluster handlers module for Zigbee Home Automation."""
|
||||
from typing import Any
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
import zigpy.zcl
|
||||
from zigpy.zcl.clusters import closures
|
||||
|
||||
from homeassistant.core import callback
|
||||
|
@ -9,6 +12,9 @@ from .. import registries
|
|||
from ..const import REPORT_CONFIG_IMMEDIATE, SIGNAL_ATTR_UPDATED
|
||||
from . import AttrReportConfig, ClientClusterHandler, ClusterHandler
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..endpoint import Endpoint
|
||||
|
||||
|
||||
@registries.ZIGBEE_CLUSTER_HANDLER_REGISTRY.register(closures.DoorLock.cluster_id)
|
||||
class DoorLockClusterHandler(ClusterHandler):
|
||||
|
@ -139,6 +145,14 @@ class WindowCovering(ClusterHandler):
|
|||
),
|
||||
)
|
||||
|
||||
def __init__(self, cluster: zigpy.zcl.Cluster, endpoint: Endpoint) -> None:
|
||||
"""Initialize WindowCovering cluster handler."""
|
||||
super().__init__(cluster, endpoint)
|
||||
|
||||
if self.cluster.endpoint.model == "lumi.curtain.agl001":
|
||||
self.ZCL_INIT_ATTRS = self.ZCL_INIT_ATTRS.copy()
|
||||
self.ZCL_INIT_ATTRS["window_covering_mode"] = True
|
||||
|
||||
async def async_update(self):
|
||||
"""Retrieve latest state."""
|
||||
result = await self.get_attribute_value(
|
||||
|
|
Loading…
Add table
Reference in a new issue