From 51aa070e19408e59b3da795c29b546bbe5d0e721 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Fri, 29 Apr 2022 21:29:06 +0200 Subject: [PATCH] Fix "station is open" binary sensor in Tankerkoenig (#70928) --- homeassistant/components/tankerkoenig/binary_sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/tankerkoenig/binary_sensor.py b/homeassistant/components/tankerkoenig/binary_sensor.py index 4b58ea26703..9a2b048e0b8 100644 --- a/homeassistant/components/tankerkoenig/binary_sensor.py +++ b/homeassistant/components/tankerkoenig/binary_sensor.py @@ -74,5 +74,5 @@ class StationOpenBinarySensorEntity(CoordinatorEntity, BinarySensorEntity): @property def is_on(self) -> bool | None: """Return true if the station is open.""" - data = self.coordinator.data[self._station_id] - return data is not None and "status" in data + data: dict = self.coordinator.data[self._station_id] + return data is not None and data.get("status") == "open"