Fix upnp raw sensor state formatting when None (#30444)

pull/30803/head
Phil Bruckner 2020-01-08 23:51:30 -06:00 committed by Paulus Schoutsen
parent 5d850c5b19
commit c7e300e5b1
1 changed files with 3 additions and 0 deletions

View File

@ -126,6 +126,9 @@ class RawUPnPIGDSensor(UpnpSensor):
@property
def state(self) -> str:
"""Return the state of the device."""
if self._state is None:
return None
return format(self._state, "d")
@property