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:
Eugenio Panadero authored and Paulus Schoutsen committed 2017-07-04 21:43:14 -07:00
1 parent f4a97db783
commit 58de661ad5
2 files changed
+18 -1

No files matched your search

+1 -1
View File
@@ -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')