Fix neato possible None state when creating entity (#49746)

This commit is contained in:
Vincent Le Bourlot
2021-04-27 13:47:20 +02:00
committed by GitHub
parent 4b8e1335bc
commit b5fdc05f5f

View File

@@ -80,7 +80,7 @@ class NeatoSensor(SensorEntity):
@property
def state(self):
"""Return the state."""
return self._state["details"]["charge"]
return self._state["details"]["charge"] if self._state else None
@property
def unit_of_measurement(self):