diff --git a/zha/application/platforms/binary_sensor/__init__.py b/zha/application/platforms/binary_sensor/__init__.py index 688cb706c..738fec12c 100644 --- a/zha/application/platforms/binary_sensor/__init__.py +++ b/zha/application/platforms/binary_sensor/__init__.py @@ -111,7 +111,6 @@ def __init__( ) super().__init__(endpoint=endpoint, device=device, **kwargs) - self._state: bool = self.is_on self.recompute_capabilities() def _is_supported(self) -> bool: @@ -145,7 +144,7 @@ def info_object(self) -> BinarySensorEntityInfo: @property def is_on(self) -> bool: """Return True if the switch is on based on the state machine.""" - self._state = raw_state = self._cluster.get(self._attribute_name) + raw_state = self._cluster.get(self._attribute_name) if raw_state is None: return False if self._attribute_converter: @@ -162,7 +161,6 @@ def handle_attribute_updated( """Handle attribute updates from the cluster.""" if self._attribute_name is None or self._attribute_name != event.attribute_name: return - self._state = bool(event.value) self.maybe_emit_state_changed_event() async def async_update(self) -> None: @@ -177,7 +175,6 @@ async def async_update(self) -> None: ) attr_value = result.get(attribute) if attr_value is not None: - self._state = attr_value self.maybe_emit_state_changed_event() @staticmethod