Add partial mobile app sensor validation (#36433)
This commit is contained in:
1 parent
84bd2067e4
commit
c7da4d77ce
3 files changed
+36
-5
No files matched your search
@@ -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"
|
||||
|
||||
|
||||
Reference in new issue
Block a user