mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Add weather condition code to OpenWeatherMap sensor (#17093)
This commit is contained in:
parent
952a1b3513
commit
16cbc2d07f
@ -39,6 +39,7 @@ SENSOR_TYPES = {
|
|||||||
'clouds': ['Cloud coverage', '%'],
|
'clouds': ['Cloud coverage', '%'],
|
||||||
'rain': ['Rain', 'mm'],
|
'rain': ['Rain', 'mm'],
|
||||||
'snow': ['Snow', 'mm'],
|
'snow': ['Snow', 'mm'],
|
||||||
|
'weather_code': ['Weather code', None],
|
||||||
}
|
}
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
@ -177,6 +178,8 @@ class OpenWeatherMapSensor(Entity):
|
|||||||
if fc_data is None:
|
if fc_data is None:
|
||||||
return
|
return
|
||||||
self._state = fc_data.get_weathers()[0].get_detailed_status()
|
self._state = fc_data.get_weathers()[0].get_detailed_status()
|
||||||
|
elif self.type == 'weather_code':
|
||||||
|
self._state = data.get_weather_code()
|
||||||
|
|
||||||
|
|
||||||
class WeatherData:
|
class WeatherData:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user