diff --git a/custom_components/wienerlinien/sensor.py b/custom_components/wienerlinien/sensor.py index 7ada209..2a156ec 100644 --- a/custom_components/wienerlinien/sensor.py +++ b/custom_components/wienerlinien/sensor.py @@ -105,7 +105,10 @@ def name(self): @property def state(self): """Return state.""" - return f"{self._state[:-2]}:{self._state[26:]}" + if self._state is None: + return self._state + else: + return f"{self._state[:-2]}:{self._state[26:]}" @property def icon(self):