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

Commit

Permalink
fix for multiple fire zones
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidFW1960 committed Nov 24, 2019
1 parent 9b0ab7c commit e41f986
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions custom_components/bom_forecast/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,13 @@ def get_reading(self, condition, index):
fire_danger_data = self._data.find(_FIND_QUERY_4.format(index))
_LOGGER.debug("fire_danger_data = %s", fire_danger_data)
if fire_danger_data is not None:
fire_danger = fire_danger_data.text
_LOGGER.debug("fire_danger = %s", fire_danger)
fire_danger = fire_danger_data.text.strip()
if fire_danger == '':
# Check if there are sub-tags.
fire_danger_data_paragraphs = fire_danger_data.findall("./p")
if fire_danger_data_paragraphs is not None:
paragraphs = [paragraph.text for paragraph in fire_danger_data_paragraphs]
return ", ".join(paragraphs)
return fire_danger
else:
_LOGGER.debug("not City")
Expand Down

0 comments on commit e41f986

Please sign in to comment.