mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 07:47:08 +00:00
Pass hass to constructor
This commit is contained in:
parent
42caa31067
commit
1a8e17ce41
@ -127,11 +127,13 @@ class WUndergroundSensor(Entity):
|
|||||||
class WUndergroundData(object):
|
class WUndergroundData(object):
|
||||||
"""Get data from Wundeground."""
|
"""Get data from Wundeground."""
|
||||||
|
|
||||||
def __init__(self, resource, pws_id, api_key, data):
|
def __init__(self, hass, api_key, pws_id=None):
|
||||||
"""Initialize the data object."""
|
"""Initialize the data object."""
|
||||||
self._resource = resource
|
self._hass = hass
|
||||||
self._api_key = api_key
|
self._api_key = api_key
|
||||||
self._pws_id = pws_id
|
self._pws_id = pws_id
|
||||||
|
self._latitude = hass.config.latitude
|
||||||
|
self._longitude = hass.config.longitude
|
||||||
self.data = None
|
self.data = None
|
||||||
|
|
||||||
def _build_url(self):
|
def _build_url(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user