Skip to content

Commit

Permalink
Remove extra from traccar webhook (#103319)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Nov 3, 2023
1 parent 8885033 commit 921d6fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion homeassistant/components/traccar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def _id(value: str) -> str:
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,
)


Expand Down
2 changes: 2 additions & 0 deletions tests/components/traccar/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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),
Expand Down

0 comments on commit 921d6fe

Please sign in to comment.