mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 14:45:09 +02: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 0e6a94aa0f
.
This commit is contained in:
committed by
Paulus Schoutsen
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
|
||||||
|
Reference in New Issue
Block a user