From 39402aff2e6e6e830fa60d93aa32f579089f3d56 Mon Sep 17 00:00:00 2001 From: arsaboo Date: Sun, 28 Aug 2016 23:05:28 -0400 Subject: [PATCH] Remove units for humidity in Wundeground sensor (#3018) * Remove units for humidity Wunderground returns the information with the units. * Trim the % from the return value of humidity --- homeassistant/components/sensor/wunderground.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/wunderground.py b/homeassistant/components/sensor/wunderground.py index 0321c4f7dcb..623016518ac 100644 --- a/homeassistant/components/sensor/wunderground.py +++ b/homeassistant/components/sensor/wunderground.py @@ -101,7 +101,10 @@ class WUndergroundSensor(Entity): def state(self): """Return the state of the sensor.""" if self.rest.data and self._condition in self.rest.data: - return self.rest.data[self._condition] + if self._condition == 'relative_humidity': + return int(self.rest.data[self._condition][:-1]) + else: + return self.rest.data[self._condition] else: return STATE_UNKNOWN