Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
update for city area uv_alert & fire_danger
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidFW1960 committed Dec 9, 2019
1 parent 7e1eb51 commit 5a345db
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions custom_components/bom_forecast/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,10 @@ def get_reading(self, condition, index):
else:
_LOGGER.debug("not City")
uv_alert_data = self._data.find(
_FIND_QUERY.format(index, 'uv_alert')).text
_FIND_QUERY.format(index, 'uv_alert'))
_LOGGER.debug("uv_alert_data = %s", uv_alert_data)
if uv_alert_data is not None:
uv_alert = self._data.find(
_FIND_QUERY.format(index, 'uv_alert')).text
uv_alert = uv_alert_data.text
_LOGGER.debug("uv_alert = %s", uv_alert)
return uv_alert

Expand All @@ -447,11 +446,10 @@ def get_reading(self, condition, index):
else:
_LOGGER.debug("not City")
fire_danger_data = self._data.find(
_FIND_QUERY.format(index, 'fire_danger')).text
_FIND_QUERY.format(index, 'fire_danger'))
_LOGGER.debug("fire_danger_data = %s", fire_danger_data)
if fire_danger_data is not None:
fire_danger = self._data.find(
_FIND_QUERY.format(index, 'fire_danger')).text
fire_danger = fire_danger_data.text
_LOGGER.debug("fire_danger = %s", fire_danger)
return fire_danger

Expand Down

0 comments on commit 5a345db

Please sign in to comment.