From c7e300e5b1684994e1ec37c90171bfa08a6262ba Mon Sep 17 00:00:00 2001 From: Phil Bruckner Date: Wed, 8 Jan 2020 23:51:30 -0600 Subject: [PATCH] Fix upnp raw sensor state formatting when None (#30444) --- homeassistant/components/upnp/sensor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/upnp/sensor.py b/homeassistant/components/upnp/sensor.py index 06e4a86401f..81fd5c025b9 100644 --- a/homeassistant/components/upnp/sensor.py +++ b/homeassistant/components/upnp/sensor.py @@ -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