Skip to content

HomeTrait does not load map (LOAD_MULTI_MAP) when map_present == 0 on single-map devices #985

Open

Description

@allenporter

Problem

When a vacuum has a saved and selected map (current_map is valid in GET_STATUS, and GET_MULTI_MAPS_LIST returns the map), the device can still report map_present: 0 in GET_STATUS while idle/docked (meaning the map is not currently loaded in the vacuum's active memory).

When GET_MAP_V1 is called while map_present == 0:

  • The device returns an empty image block (width=0, height=0).
  • vacuum-map-parser-roborock / vacuum-map-parser-base renders the "NO MAP" placeholder image (map_data.image.is_empty == True).

Currently in roborock/devices/traits/v1/home.py:

  1. HomeTrait._build_home_map_info() only calls await self._maps_trait.set_current_map(map_info.map_flag) (RoborockCommand.LOAD_MULTI_MAP) when len(sorted_map_infos) > 1:
    for map_info in sorted_map_infos:
        # We need to load each map to get its room data
        if len(sorted_map_infos) > 1:
            ...
            await self._maps_trait.set_current_map(map_info.map_flag)
    When a user only has a single saved map (multi_map_count: 1), set_current_map is skipped even when self._status_trait.map_present == 0, and the resulting "NO MAP" response is persisted into DeviceCache.
  2. HomeTrait.refresh() also does not check self._status_trait.map_present == 0 to reload the current map via set_current_map() before fetching GET_MAP_V1.

Expected Behavior

  • During HomeTrait.discover_home() / _build_home_map_info() and HomeTrait.refresh(), if self._status_trait.map_present == 0 (and the device is not busy/cleaning/returning), HomeTrait should load the map via self._maps_trait.set_current_map(...) (handling RoborockInvalidStatus -> RoborockDeviceBusy and sleeping MAP_SLEEP) before refreshing map content.
  • Avoid caching empty placeholder maps (map_data.image.is_empty) in DeviceCache as valid discovered home map content.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions