Add partial mobile app sensor validation (#36433)

This commit is contained in:
Paulus Schoutsen
2020-06-05 12:43:18 -07:00
parent 7194b74580
commit 0a779ac64c
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"