Fix "station is open" binary sensor in Tankerkoenig (#70928)

This commit is contained in:
Michael 2022-04-29 21:29:06 +02:00 committed by Paulus Schoutsen
parent 205a8fc752
commit 51aa070e19

View File

@ -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"