API POST has new state validation (fix for state = 0) (#8324)
* Fix validation of get new state * Add unittest to check posting a state with zero value
This commit is contained in:
1 parent
f4a97db783
commit
58de661ad5
2 files changed
+18
-1
No files matched your search
@@ -213,7 +213,7 @@ class APIEntityStateView(HomeAssistantView):
|
||||
|
||||
new_state = data.get('state')
|
||||
|
||||
if not new_state:
|
||||
if new_state is None:
|
||||
return self.json_message('No state specified', HTTP_BAD_REQUEST)
|
||||
|
||||
attributes = data.get('attributes')
|
||||
|
||||
Reference in new issue
Block a user