Remove extra from traccar webhook (#103319)

This commit is contained in:
Joakim Sørensen 2023-11-03 17:44:48 +01:00 committed by GitHub
parent 88850334f1
commit 921d6feae7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -50,7 +50,8 @@ WEBHOOK_SCHEMA = vol.Schema(
vol.Optional(ATTR_BEARING): vol.Coerce(float),
vol.Optional(ATTR_SPEED): vol.Coerce(float),
vol.Optional(ATTR_TIMESTAMP): vol.Coerce(int),
}
},
extra=vol.REMOVE_EXTRA,
)

View File

@ -153,6 +153,7 @@ async def test_enter_with_attrs(hass: HomeAssistant, client, webhook_id) -> None
"speed": 100,
"bearing": "105.32",
"altitude": 102,
"charge": "true",
}
req = await client.post(url, params=data)
@ -165,6 +166,7 @@ async def test_enter_with_attrs(hass: HomeAssistant, client, webhook_id) -> None
assert state.attributes["speed"] == 100.0
assert state.attributes["bearing"] == 105.32
assert state.attributes["altitude"] == 102.0
assert "charge" not in state.attributes
data = {
"lat": str(HOME_LATITUDE),