mirror of
https://github.com/home-assistant/core.git
synced 2025-08-11 00:25:12 +02:00
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
This commit is contained in:
@@ -101,6 +101,9 @@ class WUndergroundSensor(Entity):
|
|||||||
def state(self):
|
def state(self):
|
||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
if self.rest.data and self._condition in self.rest.data:
|
if self.rest.data and self._condition in self.rest.data:
|
||||||
|
if self._condition == 'relative_humidity':
|
||||||
|
return int(self.rest.data[self._condition][:-1])
|
||||||
|
else:
|
||||||
return self.rest.data[self._condition]
|
return self.rest.data[self._condition]
|
||||||
else:
|
else:
|
||||||
return STATE_UNKNOWN
|
return STATE_UNKNOWN
|
||||||
|
Reference in New Issue
Block a user