mirror of
https://github.com/home-assistant/core.git
synced 2025-04-22 16:27:56 +00:00
Remove extra from traccar webhook (#103319)
This commit is contained in:
parent
88850334f1
commit
921d6feae7
@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user