mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Merge pull request #957 from trollkarlen/yr.no-fix
yr.no: fix some bugs in the component
This commit is contained in:
commit
7f143bcdf9
@ -25,6 +25,7 @@ SENSOR_TYPES = {
|
|||||||
'precipitation': ['Condition', 'mm'],
|
'precipitation': ['Condition', 'mm'],
|
||||||
'temperature': ['Temperature', '°C'],
|
'temperature': ['Temperature', '°C'],
|
||||||
'windSpeed': ['Wind speed', 'm/s'],
|
'windSpeed': ['Wind speed', 'm/s'],
|
||||||
|
'windGust': ['Wind gust', 'm/s'],
|
||||||
'pressure': ['Pressure', 'mbar'],
|
'pressure': ['Pressure', 'mbar'],
|
||||||
'windDirection': ['Wind direction', '°'],
|
'windDirection': ['Wind direction', '°'],
|
||||||
'humidity': ['Humidity', '%'],
|
'humidity': ['Humidity', '%'],
|
||||||
@ -143,11 +144,11 @@ class YrSensor(Entity):
|
|||||||
elif self.type == 'symbol' and valid_from < now:
|
elif self.type == 'symbol' and valid_from < now:
|
||||||
self._state = loc_data[self.type]['@number']
|
self._state = loc_data[self.type]['@number']
|
||||||
break
|
break
|
||||||
elif self.type == ('temperature', 'pressure', 'humidity',
|
elif self.type in ('temperature', 'pressure', 'humidity',
|
||||||
'dewpointTemperature'):
|
'dewpointTemperature'):
|
||||||
self._state = loc_data[self.type]['@value']
|
self._state = loc_data[self.type]['@value']
|
||||||
break
|
break
|
||||||
elif self.type == 'windSpeed':
|
elif self.type in ('windSpeed', 'windGust'):
|
||||||
self._state = loc_data[self.type]['@mps']
|
self._state = loc_data[self.type]['@mps']
|
||||||
break
|
break
|
||||||
elif self.type == 'windDirection':
|
elif self.type == 'windDirection':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user