Removed lynting issues
This commit is contained in:
1 parent
aabeda2b60
commit
1a34bc5301
1 file changed
+7
-7
@@ -1,4 +1,4 @@
|
|||||||
"""Support for Wunderground weather service."""
|
"""Support for Wunderground weather service.
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
import requests
|
import requests
|
||||||
@@ -90,15 +90,15 @@ class WUndergroundSensor(Entity):
|
|||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
self.weather = self.rest.data
|
value = self.rest.data
|
||||||
return self.weather[str(self._condition)]
|
return value[str(self._condition)]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def entity_picture(self):
|
def entity_picture(self):
|
||||||
"""Return the entity picture."""
|
"""Return the entity picture."""
|
||||||
self.weather = self.rest.data
|
value = self.rest.data
|
||||||
if self._condition == 'weather':
|
if self._condition == 'weather':
|
||||||
return self.weather['icon_url']
|
return value['icon_url']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
@@ -114,7 +114,7 @@ class WUndergroundSensor(Entity):
|
|||||||
|
|
||||||
|
|
||||||
class WUndergroundData(object):
|
class WUndergroundData(object):
|
||||||
"""Get data from Wunderground."""
|
"""Get data from Wundeground."""
|
||||||
|
|
||||||
def __init__(self, resource, pws_id, api_key, data):
|
def __init__(self, resource, pws_id, api_key, data):
|
||||||
"""Initialize the data object."""
|
"""Initialize the data object."""
|
||||||
@@ -129,7 +129,7 @@ class WUndergroundData(object):
|
|||||||
"""Get the latest data from wunderground"""
|
"""Get the latest data from wunderground"""
|
||||||
try:
|
try:
|
||||||
result = requests.get(self._resource + self._api_key +
|
result = requests.get(self._resource + self._api_key +
|
||||||
'/conditions/q/pws:' + self._pws_id +
|
'/conditions/q/pws:' + self._pws_id +
|
||||||
'.json', timeout=10)
|
'.json', timeout=10)
|
||||||
if "error" in result.json():
|
if "error" in result.json():
|
||||||
raise ValueError(result.json()["response"]["error"]
|
raise ValueError(result.json()["response"]["error"]
|
||||||
|
|||||||
Reference in new issue
Block a user