Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for the svg map #768

Merged
merged 5 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion deebot_client/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,18 @@ async def on_minor_map(event: MinorMapEvent) -> None:

unsubscribers.append(self._event_bus.subscribe(MinorMapEvent, on_minor_map))

self._event_bus.request_refresh(CachedMapInfoEvent)
async def on_cached_info(_: CachedMapInfoEvent) -> None:
# We need to subscribe to it, otherwise it could happen
# that the required MapSet Events are not get
pass

cached_map_subscribers = self._event_bus.has_subscribers(CachedMapInfoEvent)
unsubscribers.append(
self._event_bus.subscribe(CachedMapInfoEvent, on_cached_info)
)
if cached_map_subscribers:
# Request update only if there was already a subscriber before
self._event_bus.request_refresh(CachedMapInfoEvent)

async def on_position(event: PositionsEvent) -> None:
self._map_data.positions = event.positions
Expand Down
Loading
Loading