Skip to content

Commit

Permalink
fixed issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bouni committed May 24, 2020
1 parent 57b52ac commit e43e13a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions custom_components/drkblutspende/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Set up date sensor."""
zipcode = config.get(CONF_ZIPCODE)
radius = config.get(CONF_RADIUS)
countyid = config.get(CONF_COUNTY_ID)
lookahead = config.get(CONF_LOOKAHEAD)
timeformat = config.get(CONF_TIMEFORMAT)
zipfilter = config.get(CONF_ZIPFILTER)
zipcode = config.get(CONF_ZIPCODE,"")
radius = config.get(CONF_RADIUS,"")
countyid = config.get(CONF_COUNTY_ID,"")
lookahead = config.get(CONF_LOOKAHEAD,"")
timeformat = config.get(CONF_TIMEFORMAT,"")
zipfilter = config.get(CONF_ZIPFILTER,"")

devices = []
devices.append(
Expand Down Expand Up @@ -124,6 +124,7 @@ def get_data(self):
feed = feedparser.parse(
f"{url}?term={self._zipcode}&radius={self._radius}&county_id={self._countyid}&date_to={date_to}"
)
_LOGGER.debug(f"{url}?term={self._zipcode}&radius={self._radius}&county_id={self._countyid}&date_to={date_to} gave status code {feed.status}")
except Exception as e:
_LOGGER.error("Couldn't get data from spenderservice.net")
return
Expand Down

0 comments on commit e43e13a

Please sign in to comment.