Add partial mobile app sensor validation (#36433)

This commit is contained in:
Paulus Schoutsen
2020-06-04 10:02:40 -07:00
parent 84bd2067e4
commit c7da4d77ce
3 changed files with 36 additions and 5 deletions
+6 -1
View File
@@ -57,13 +57,18 @@ async def test_sensor(hass, create_registrations, webhook_client):
"state": 123,
"type": "sensor",
"unique_id": "battery_state",
}
},
# This invalid data should not invalidate whole request
{"type": "sensor", "unique_id": "invalid_state", "invalid": "data"},
],
},
)
assert update_resp.status == 200
json = await update_resp.json()
assert json["invalid_state"]["success"] is False
updated_entity = hass.states.get("sensor.test_1_battery_state")
assert updated_entity.state == "123"