Skip to content

Conversation

@Lash-L
Copy link
Collaborator

@Lash-L Lash-L commented Jan 18, 2026

relates to: home-assistant/core#160812

Some devices seem to sometimes contain rooms in the map info response.

Use it unless the get_room_mapping is giving good data back. I think there might be a bigger issue at play, but without seeing the user's home data, I'm not sure I can figure it out. This is likely a good change regardless though and should add some more stability to room names (for the devices that support it)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for extracting room information from the map_info response, which some devices occasionally provide. The implementation merges room data from both map_info and the existing rooms_trait, with intelligent prioritization to preserve meaningful room names.

Changes:

  • Added MultiMapsListRoom data container and rooms field to MultiMapsListMapInfo to capture room data from API responses
  • Modified _refresh_map_info method to merge rooms from map_info and rooms_trait, preferring non-"Unknown" names
  • Added comprehensive test coverage for the new room merging logic

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
roborock/data/v1/v1_containers.py Adds MultiMapsListRoom dataclass and rooms field to MultiMapsListMapInfo to support room data in map responses
roborock/devices/traits/v1/home.py Implements room merging logic in _refresh_map_info to combine rooms from map_info and rooms_trait, preserving meaningful names
tests/devices/traits/v1/test_home.py Adds comprehensive test for room override and addition logic covering all four scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +137 to +138
# Add the room to rooms if the room segment is not already in it
# or if the room name isn't unknown.
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is slightly confusing. It says "Add the room to rooms if the room segment is not already in it or if the room name isn't unknown" but this doesn't clarify that if both conditions are true (room exists AND name is "Unknown"), the room won't be added/overridden. Consider rewording to: "Add or override the room unless it already exists in rooms and the current name is 'Unknown'".

Suggested change
# Add the room to rooms if the room segment is not already in it
# or if the room name isn't unknown.
# Add or override the room unless it already exists in rooms
# and the current name is "Unknown".

Copilot uses AI. Check for mistakes.

rooms: dict[int, NamedRoomMapping] = {}
if map_info.rooms:
# Not all vacuums resopnd with rooms inside map_info.
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "resopnd" should be "respond".

Suggested change
# Not all vacuums resopnd with rooms inside map_info.
# Not all vacuums respond with rooms inside map_info.

Copilot uses AI. Check for mistakes.
allenporter
allenporter previously approved these changes Jan 18, 2026
@Lash-L
Copy link
Collaborator Author

Lash-L commented Jan 19, 2026

Fixed tests - re-approve whenever you have a moment - no rush @allenporter

@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 92.68293% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
roborock/devices/traits/v1/home.py 72.72% 0 Missing and 3 partials ⚠️
Files with missing lines Coverage Δ
roborock/data/v1/v1_containers.py 91.87% <100.00%> (+0.14%) ⬆️
tests/devices/traits/v1/test_home.py 99.21% <100.00%> (+0.07%) ⬆️
roborock/devices/traits/v1/home.py 91.60% <72.72%> (-1.79%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Lash-L Lash-L merged commit 814054e into main Jan 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants