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 GitHub
parent 11b91e44c8
commit d90937182e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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"