File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
zha/application/platforms/binary_sensor Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -247,16 +247,10 @@ class IASZone(BinarySensor):
247247
248248 # TODO: split this sensor off into individual sensor classes per IASZone type
249249
250- def __init__ (
251- self ,
252- cluster_handlers : list [ClusterHandler ],
253- endpoint : Endpoint ,
254- device : Device ,
255- ** kwargs ,
256- ) -> None :
257- """Initialize the ZHA binary sensor."""
258- cluster_handler = cluster_handlers [0 ]
259- zone_type = cluster_handler .cluster .get ("zone_type" )
250+ def recompute_capabilities (self ) -> None :
251+ """Recompute capabilities."""
252+ super ().recompute_capabilities ()
253+ zone_type = self ._cluster_handler .cluster .get ("zone_type" )
260254
261255 if zone_type is None :
262256 self ._attr_translation_key = "ias_zone"
@@ -268,8 +262,6 @@ def __init__(
268262 )
269263 self ._attr_device_class = IAS_ZONE_CLASS_MAPPING .get (zone_type )
270264
271- super ().__init__ (cluster_handlers , endpoint , device , ** kwargs )
272-
273265 @staticmethod
274266 def parse (value : bool | int ) -> bool :
275267 """Parse the raw attribute into a bool state."""
You can’t perform that action at this time.
0 commit comments