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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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):