Update pwaqi to 3.0 to use public API (#6376)

The underlying PWAQI library version 3.0 is now using public API to
access AQICN data.
This commit is contained in:
Valentin Alexeev 2017-03-03 15:50:54 +02:00 committed by Pascal Vizeli
parent edf130b341
commit 568c549353
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ from homeassistant.helpers.config_validation import PLATFORM_SCHEMA
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle from homeassistant.util import Throttle
REQUIREMENTS = ['pwaqi==2.0'] REQUIREMENTS = ['pwaqi==3.0']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -162,7 +162,7 @@ class WaqiData(object):
"""Get the data from World Air Quality Index and updates the states.""" """Get the data from World Air Quality Index and updates the states."""
import pwaqi import pwaqi
try: try:
self.data = pwaqi.getStationObservation( self.data = pwaqi.get_station_observation(
self._station_id, self._token) self._station_id, self._token)
except AttributeError: except AttributeError:
_LOGGER.exception("Unable to fetch data from WAQI") _LOGGER.exception("Unable to fetch data from WAQI")

View File

@ -433,7 +433,7 @@ pushbullet.py==0.10.0
pushetta==1.0.15 pushetta==1.0.15
# homeassistant.components.sensor.waqi # homeassistant.components.sensor.waqi
pwaqi==2.0 pwaqi==3.0
# homeassistant.components.sensor.cpuspeed # homeassistant.components.sensor.cpuspeed
py-cpuinfo==0.2.6 py-cpuinfo==0.2.6