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 0e6a94aa0f
.
This commit is contained in:
parent
961c02f72a
commit
1f468fc94d
1 changed files with 5 additions and 2 deletions
|
@ -117,8 +117,11 @@ class WUndergroundSensor(Entity):
|
|||
else:
|
||||
return self.rest.data[self._condition]
|
||||
|
||||
if self.rest.alerts and self._condition == 'alerts':
|
||||
return len(self.rest.alerts)
|
||||
if self._condition == 'alerts':
|
||||
if self.rest.alerts:
|
||||
return len(self.rest.alerts)
|
||||
else:
|
||||
return 0
|
||||
return STATE_UNKNOWN
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Reference in a new issue