Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions homeassistant/components/sensor/luftdaten.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle

REQUIREMENTS = ['luftdaten==0.1.1']
REQUIREMENTS = ['luftdaten==0.1.3']

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -114,17 +114,17 @@ def unit_of_measurement(self):
@property
def device_state_attributes(self):
"""Return the state attributes."""
if self.luftdaten.data.meta is None:
try:
attr = {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_SENSOR_ID: self._sensor_id,
'lat': self.luftdaten.data.meta['latitude'],
'long': self.luftdaten.data.meta['longitude'],
}
return attr
except KeyError:
return

attr = {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_SENSOR_ID: self._sensor_id,
'lat': self.luftdaten.data.meta['latitude'],
'long': self.luftdaten.data.meta['longitude'],
}
return attr

@asyncio.coroutine
def async_update(self):
"""Get the latest data from luftdaten.info and update the state."""
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ liveboxplaytv==2.0.2
lmnotify==0.0.4

# homeassistant.components.sensor.luftdaten
luftdaten==0.1.1
luftdaten==0.1.3

# homeassistant.components.sensor.lyft
lyft_rides==0.2
Expand Down