Skip to content

Commit

Permalink
Merge pull request #28 from dulek/robojet-map-fix
Browse files Browse the repository at this point in the history
Fix map for RobotJet X-Style
  • Loading branch information
Jezza34000 authored Feb 12, 2024
2 parents 96716ec + 75c7252 commit 5e6133c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions custom_components/weback_vacuum/vacdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
VacDevice Module
"""

import asyncio
import io
import logging

Expand Down Expand Up @@ -58,9 +59,19 @@ async def watch_state(self):
"Error on watch_state starting refresh_handler %s", watch_excpt
)

def on_message(self, ws, message):
# Call the function on webackapi first, it'll update the status.
super().on_message(ws, message)

# Some vacuums won't have hismap_id in the initial status, but will
# report it later on. Let's make sure we try to load map again then.
if self.ACTIVE_MAP_ID_PROP in self.robot_status and not self.map:
asyncio.run(self.load_maps())

async def load_maps(self):
"""Load the current reuse map"""

_LOGGER.debug("load_maps")
if self.ACTIVE_MAP_ID_PROP not in self.robot_status:
return False

Expand Down

0 comments on commit 5e6133c

Please sign in to comment.