Publish attributes unconditionally (#14179)
* Publish attributes unconditionally Because the attribute publish command was previously hidden behind `if val:`, falsy values like False and 0.0 weren't being published, thereby making Statestream -- particularly in the case of booleans, where the first True would be retained indefinitely -- a completely worthless indicator of state. * Change bool test to False to confirm falsy values pass
This commit is contained in:
1 parent
5ade84d75f
commit
ec3ce4c80d
2 files changed
+5
-6
No files matched your search
@@ -134,7 +134,7 @@ class TestMqttStateStream(object):
|
||||
test_attributes = {
|
||||
"testing": "YES",
|
||||
"list": ["a", "b", "c"],
|
||||
"bool": True
|
||||
"bool": False
|
||||
}
|
||||
|
||||
# Set a state of an entity
|
||||
@@ -150,7 +150,7 @@ class TestMqttStateStream(object):
|
||||
1, True),
|
||||
call.async_publish(self.hass, 'pub/fake/entity/list',
|
||||
'["a", "b", "c"]', 1, True),
|
||||
call.async_publish(self.hass, 'pub/fake/entity/bool', "true",
|
||||
call.async_publish(self.hass, 'pub/fake/entity/bool', "false",
|
||||
1, True)
|
||||
]
|
||||
|
||||
|
||||
Reference in new issue
Block a user