Add weather condition code to OpenWeatherMap sensor (#17093)

This commit is contained in:
David Bilay 2018-10-03 16:15:45 +02:00 committed by Fabian Affolter
parent 952a1b3513
commit 16cbc2d07f

View file

@ -39,6 +39,7 @@ SENSOR_TYPES = {
'clouds': ['Cloud coverage', '%'],
'rain': ['Rain', 'mm'],
'snow': ['Snow', 'mm'],
'weather_code': ['Weather code', None],
}
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
@ -177,6 +178,8 @@ class OpenWeatherMapSensor(Entity):
if fc_data is None:
return
self._state = fc_data.get_weathers()[0].get_detailed_status()
elif self.type == 'weather_code':
self._state = data.get_weather_code()
class WeatherData: