yr.no: fix some bugs in the component
Someone forgot some in:s and () Also added windGust sensor. Signed-off-by: Robert Marklund <robbelibobban@gmail.com>
This commit is contained in:
parent
1098194a89
commit
f19a46dcfe
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue