Fix upnp raw sensor state formatting when None (#30444)
parent
fe0b537291
commit
260596d11b
|
@ -126,6 +126,9 @@ class RawUPnPIGDSensor(UpnpSensor):
|
||||||
@property
|
@property
|
||||||
def state(self) -> str:
|
def state(self) -> str:
|
||||||
"""Return the state of the device."""
|
"""Return the state of the device."""
|
||||||
|
if self._state is None:
|
||||||
|
return None
|
||||||
|
|
||||||
return format(self._state, "d")
|
return format(self._state, "d")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in New Issue