From d1e16759fd5fc9a48b86f302119a5e62f77760d4 Mon Sep 17 00:00:00 2001 From: Brett Adams Date: Tue, 9 Jul 2024 10:17:36 +0000 Subject: [PATCH] Fix binary restore --- custom_components/teslemetry/binary_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/teslemetry/binary_sensor.py b/custom_components/teslemetry/binary_sensor.py index 3b15e33..1981743 100644 --- a/custom_components/teslemetry/binary_sensor.py +++ b/custom_components/teslemetry/binary_sensor.py @@ -302,7 +302,7 @@ async def async_added_to_hass(self) -> None: """Handle entity which will be added.""" await super().async_added_to_hass() if (state := await self.async_get_last_state()) is not None: - self._state = state.state == "on" + self._attr_is_on = state.state == "on" def _async_update_attrs(self) -> None: """Update the attributes of the binary sensor."""