mirror of
https://github.com/home-assistant/core.git
synced 2025-05-09 08:29:20 +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:
|
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':
|
||||||
|
if self.rest.alerts:
|
||||||
return len(self.rest.alerts)
|
return len(self.rest.alerts)
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
return STATE_UNKNOWN
|
return STATE_UNKNOWN
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user