Add Yahoo! weather platform (#7939)
This commit is contained in:
1 parent
b87e31617a
commit
d38acfbd39
4 files changed
+202
-4
No files matched your search
@@ -22,16 +22,17 @@ DOMAIN = 'weather'
|
||||
ENTITY_ID_FORMAT = DOMAIN + '.{}'
|
||||
|
||||
ATTR_CONDITION_CLASS = 'condition_class'
|
||||
ATTR_FORECAST = 'forecast'
|
||||
ATTR_FORECAST_TEMP = 'temperature'
|
||||
ATTR_FORECAST_TIME = 'datetime'
|
||||
ATTR_WEATHER_ATTRIBUTION = 'attribution'
|
||||
ATTR_WEATHER_HUMIDITY = 'humidity'
|
||||
ATTR_WEATHER_OZONE = 'ozone'
|
||||
ATTR_WEATHER_PRESSURE = 'pressure'
|
||||
ATTR_WEATHER_TEMPERATURE = 'temperature'
|
||||
ATTR_WEATHER_VISIBILITY = 'visibility'
|
||||
ATTR_WEATHER_WIND_BEARING = 'wind_bearing'
|
||||
ATTR_WEATHER_WIND_SPEED = 'wind_speed'
|
||||
ATTR_FORECAST = 'forecast'
|
||||
ATTR_FORECAST_TEMP = 'temperature'
|
||||
ATTR_FORECAST_TIME = 'datetime'
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
@@ -45,7 +46,7 @@ def async_setup(hass, config):
|
||||
|
||||
# pylint: disable=no-member, no-self-use
|
||||
class WeatherEntity(Entity):
|
||||
"""ABC for a weather data."""
|
||||
"""ABC for weather data."""
|
||||
|
||||
@property
|
||||
def temperature(self):
|
||||
@@ -87,6 +88,11 @@ class WeatherEntity(Entity):
|
||||
"""Return the attribution."""
|
||||
return None
|
||||
|
||||
@property
|
||||
def visibility(self):
|
||||
"""Return the visibility."""
|
||||
return None
|
||||
|
||||
@property
|
||||
def forecast(self):
|
||||
"""Return the forecast."""
|
||||
@@ -116,6 +122,10 @@ class WeatherEntity(Entity):
|
||||
if wind_speed is not None:
|
||||
data[ATTR_WEATHER_WIND_SPEED] = wind_speed
|
||||
|
||||
visibility = self.visibility
|
||||
if visibility is not None:
|
||||
data[ATTR_WEATHER_VISIBILITY] = visibility
|
||||
|
||||
attribution = self.attribution
|
||||
if attribution is not None:
|
||||
data[ATTR_WEATHER_ATTRIBUTION] = attribution
|
||||
|
||||
Reference in new issue
Block a user