Add empty string to list of invalid states (#72590)
Add null state to list of invalid states
This commit is contained in:
parent
285a7251df
commit
6f8ba7ee2f
1 changed files with 1 additions and 1 deletions
|
@ -350,7 +350,7 @@ class StatisticsSensor(SensorEntity):
|
||||||
if new_state.state == STATE_UNAVAILABLE:
|
if new_state.state == STATE_UNAVAILABLE:
|
||||||
self.attributes[STAT_SOURCE_VALUE_VALID] = None
|
self.attributes[STAT_SOURCE_VALUE_VALID] = None
|
||||||
return
|
return
|
||||||
if new_state.state in (STATE_UNKNOWN, None):
|
if new_state.state in (STATE_UNKNOWN, None, ""):
|
||||||
self.attributes[STAT_SOURCE_VALUE_VALID] = False
|
self.attributes[STAT_SOURCE_VALUE_VALID] = False
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue