Upgrade pyowm to 2.8.0 (#11332)

This commit is contained in:
Fabian Affolter 2017-12-29 10:06:52 +01:00 committed by GitHub
parent 391a8901c8
commit d7e52d8014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 14 deletions

View File

@ -4,20 +4,20 @@ Support for the OpenWeatherMap (OWM) service.
For more details about this platform, please refer to the documentation at For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.openweathermap/ https://home-assistant.io/components/sensor.openweathermap/
""" """
import logging
from datetime import timedelta from datetime import timedelta
import logging
import voluptuous as vol import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ( from homeassistant.const import (
CONF_API_KEY, CONF_NAME, TEMP_CELSIUS, TEMP_FAHRENHEIT, ATTR_ATTRIBUTION, CONF_API_KEY, CONF_MONITORED_CONDITIONS, CONF_NAME,
CONF_MONITORED_CONDITIONS, ATTR_ATTRIBUTION) TEMP_CELSIUS, TEMP_FAHRENHEIT)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle from homeassistant.util import Throttle
REQUIREMENTS = ['pyowm==2.7.1'] REQUIREMENTS = ['pyowm==2.8.0']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -53,12 +53,12 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def setup_platform(hass, config, add_devices, discovery_info=None): def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the OpenWeatherMap sensor.""" """Set up the OpenWeatherMap sensor."""
from pyowm import OWM
if None in (hass.config.latitude, hass.config.longitude): if None in (hass.config.latitude, hass.config.longitude):
_LOGGER.error("Latitude or longitude not set in Home Assistant config") _LOGGER.error("Latitude or longitude not set in Home Assistant config")
return False return False
from pyowm import OWM
SENSOR_TYPES['temperature'][1] = hass.config.units.temperature_unit SENSOR_TYPES['temperature'][1] = hass.config.units.temperature_unit
name = config.get(CONF_NAME) name = config.get(CONF_NAME)

View File

@ -4,27 +4,29 @@ Support for the OpenWeatherMap (OWM) service.
For more details about this platform, please refer to the documentation at For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/weather.openweathermap/ https://home-assistant.io/components/weather.openweathermap/
""" """
import logging
from datetime import timedelta from datetime import timedelta
import logging
import voluptuous as vol import voluptuous as vol
from homeassistant.components.weather import ( from homeassistant.components.weather import (
WeatherEntity, PLATFORM_SCHEMA, ATTR_FORECAST_TEMP, ATTR_FORECAST_TIME) ATTR_FORECAST_TEMP, ATTR_FORECAST_TIME, PLATFORM_SCHEMA, WeatherEntity)
from homeassistant.const import (CONF_API_KEY, CONF_NAME, CONF_LATITUDE, from homeassistant.const import (
CONF_LONGITUDE, STATE_UNKNOWN, TEMP_CELSIUS) CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME, STATE_UNKNOWN,
TEMP_CELSIUS)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle from homeassistant.util import Throttle
REQUIREMENTS = ['pyowm==2.7.1'] REQUIREMENTS = ['pyowm==2.8.0']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'OpenWeatherMap'
ATTRIBUTION = 'Data provided by OpenWeatherMap' ATTRIBUTION = 'Data provided by OpenWeatherMap'
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=10) DEFAULT_NAME = 'OpenWeatherMap'
MIN_TIME_BETWEEN_FORECAST_UPDATES = timedelta(minutes=30) MIN_TIME_BETWEEN_FORECAST_UPDATES = timedelta(minutes=30)
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=10)
CONDITION_CLASSES = { CONDITION_CLASSES = {
'cloudy': [804], 'cloudy': [804],

View File

@ -797,7 +797,7 @@ pyotp==2.2.6
# homeassistant.components.sensor.openweathermap # homeassistant.components.sensor.openweathermap
# homeassistant.components.weather.openweathermap # homeassistant.components.weather.openweathermap
pyowm==2.7.1 pyowm==2.8.0
# homeassistant.components.qwikswitch # homeassistant.components.qwikswitch
pyqwikswitch==0.4 pyqwikswitch==0.4