Skip to content

Commit

Permalink
Merge pull request #575 from Thomas55555/Fix-position-event-v2
Browse files Browse the repository at this point in the history
Fix position-event-v2
  • Loading branch information
Thomas55555 authored Jan 7, 2025
2 parents c6951c8 + 661fc36 commit 6cac00a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/aioautomower/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class EventTypesV2(StrEnum):
MESSAGES = "messages-event-v2"
MOWER = "mower-event-v2"
PLANNER = "planner-event-v2"
POSITIONS = "positions-event-v2"
POSITIONS = "position-event-v2"


class DayOfWeek(IntEnum):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "c7233734-b219-4287-a173-08e3643f89f0",
"type": "positions-event-v2",
"type": "position-event-v2",
"attributes": {
"position": {
"latitude": 57.70074,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,14 +546,14 @@ async def test_full_planner_event(
assert automower_api.rest_task.cancelled()


async def test_positions_event(mock_automower_client: AbstractAuth):
async def test_position_event(mock_automower_client: AbstractAuth):
"""Test automower websocket V2 positions update."""
automower_api = AutomowerSession(mock_automower_client, poll=True)
await automower_api.connect()
assert automower_api.data[MOWER_ID].positions[0] == Positions(
35.5402913, -82.5527055
)
msg = WSMessage(WSMsgType.TEXT, load_fixture("events/positions_event.json"), None)
msg = WSMessage(WSMsgType.TEXT, load_fixture("events/position_event.json"), None)
automower_api._handle_text_message(msg) # noqa: SLF001
assert automower_api.data[MOWER_ID].positions[0] == Positions(57.70074, 14.4787133)
await automower_api.close()
Expand Down

0 comments on commit 6cac00a

Please sign in to comment.