From 25c0739e224d8bf3feb89f19da1151267555bbc2 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 2 Jun 2021 14:32:25 +0200 Subject: [PATCH] Mark state final in BinarySensorEntity (#51234) --- homeassistant/components/binary_sensor/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/binary_sensor/__init__.py b/homeassistant/components/binary_sensor/__init__.py index c7e1bac9952..d698a9c306e 100644 --- a/homeassistant/components/binary_sensor/__init__.py +++ b/homeassistant/components/binary_sensor/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from datetime import timedelta import logging +from typing import final import voluptuous as vol @@ -150,12 +151,14 @@ class BinarySensorEntity(Entity): """Represent a binary sensor.""" _attr_is_on: bool | None = None + _attr_state: None = None @property def is_on(self) -> bool | None: """Return true if the binary sensor is on.""" return self._attr_is_on + @final @property def state(self) -> StateType: """Return the state of the binary sensor."""