mirror of
https://github.com/home-assistant/core.git
synced 2025-05-08 16:09:22 +00:00
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.
This commit is contained in:
parent
961c02f72a
commit
1f468fc94d
@ -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…
x
Reference in New Issue
Block a user