Skip to content
Snippets Groups Projects
Commit 1f468fc9 authored by Marcelo Moreira de Mello's avatar Marcelo Moreira de Mello Committed by Paulus Schoutsen
Browse files

If no weather advisories were issued, state should return 0 instead Unknown (#4029)

* If no weather advisories were issued, state should return 0 instead Unknown

* Updated to keep on the same if statement

* Revert "Updated to keep on the same if statement"

This reverts commit 0e6a94aa0fa9b80dc60c7b222423fe71e1dda81b.
parent 961c02f7
Branches
Tags
No related merge requests found
...@@ -117,8 +117,11 @@ class WUndergroundSensor(Entity): ...@@ -117,8 +117,11 @@ class WUndergroundSensor(Entity):
else: else:
return self.rest.data[self._condition] return self.rest.data[self._condition]
if self.rest.alerts and self._condition == 'alerts': if self._condition == 'alerts':
return len(self.rest.alerts) if self.rest.alerts:
return len(self.rest.alerts)
else:
return 0
return STATE_UNKNOWN return STATE_UNKNOWN
@property @property
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment