Skip to content

Fix room ids#147

Merged
chipp merged 1 commit intomainfrom
fix-room-ids
Jan 12, 2026
Merged

Fix room ids#147
chipp merged 1 commit intomainfrom
fix-room-ids

Conversation

@chipp
Copy link
Owner

@chipp chipp commented Jan 12, 2026

TL;DR

Added Bathroom and Toilet rooms to the room mapping and updated room IDs to match the vacuum's configuration.

What changed?

  • Added Bathroom (ID: 16) and Toilet (ID: 22) to the room mapping functions
  • Updated existing room IDs:
    • Corridor: 16 → 23
    • Hallway: 20 → 24
  • Reordered the room mapping for better readability
  • Added a new script get_room_mapping_local.py to help retrieve room mappings from the Roborock vacuum

How to test?

  1. Run the new script to verify room mappings:
    python3 scripts/get_room_mapping_local.py
    
  2. Verify that the room IDs in the code match those returned by the vacuum
  3. Test that the application correctly identifies and displays all rooms, including the newly added Bathroom and Toilet

Why make this change?

The room IDs in the code were out of sync with the actual room configuration on the vacuum. This change ensures that the application correctly maps room IDs to their corresponding physical spaces, adding support for Bathroom and Toilet rooms that were previously missing. The new script provides a way to easily retrieve and verify room mappings directly from the vacuum for future updates.

@gemini-code-assist
Copy link

Summary of Changes

Hello @chipp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue with room ID assignments by remapping existing room types and introducing new ones to ensure consistency and accommodate additional room definitions. It also includes a new utility script designed to retrieve and display room mappings from Roborock devices, which will be instrumental in validating and understanding the updated room ID scheme.

Highlights

  • Room ID Reassignment: Existing room IDs for Corridor and Hallway have been updated to new, distinct values to prevent potential conflicts and ensure unique identification.
  • New Room Type Support: Mappings for Bathroom and Toilet room types have been added, assigning them specific IDs within the system.
  • Roborock Room Mapping Utility: A new Python script (scripts/get_room_mapping_local.py) has been introduced. This utility fetches and displays room mappings directly from Roborock vacuum cleaners, which will be valuable for debugging and verifying room ID configurations.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Owner Author

chipp commented Jan 12, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the room ID mappings in the Rust code and adds a Python script, presumably used to discover the correct mappings. The core logic change to fix the room IDs is correct. I've added a couple of suggestions to improve code quality: one to enhance readability in the Rust mapping function by sorting the match arms, and another to remove some redundant code from the new Python script.

Comment on lines +244 to +251
16 => Some(transport::Room::Bathroom),
17 => Some(transport::Room::Bedroom),
18 => Some(transport::Room::LivingRoom),
19 => Some(transport::Room::Kitchen),
20 => Some(transport::Room::Hallway),
23 => Some(transport::Room::Corridor),
24 => Some(transport::Room::Hallway),
21 => Some(transport::Room::HomeOffice),
19 => Some(transport::Room::Kitchen),
18 => Some(transport::Room::LivingRoom),
22 => Some(transport::Room::Toilet),

Choose a reason for hiding this comment

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

medium

For better readability and maintainability, it's a good practice to sort the match arms by the integer value. This makes it easier to find a specific ID and to spot any missing or overlapping ranges.

Suggested change
16 => Some(transport::Room::Bathroom),
17 => Some(transport::Room::Bedroom),
18 => Some(transport::Room::LivingRoom),
19 => Some(transport::Room::Kitchen),
20 => Some(transport::Room::Hallway),
23 => Some(transport::Room::Corridor),
24 => Some(transport::Room::Hallway),
21 => Some(transport::Room::HomeOffice),
19 => Some(transport::Room::Kitchen),
18 => Some(transport::Room::LivingRoom),
22 => Some(transport::Room::Toilet),
16 => Some(transport::Room::Bathroom),
17 => Some(transport::Room::Bedroom),
18 => Some(transport::Room::LivingRoom),
19 => Some(transport::Room::Kitchen),
21 => Some(transport::Room::HomeOffice),
22 => Some(transport::Room::Toilet),
23 => Some(transport::Room::Corridor),
24 => Some(transport::Room::Hallway),

Comment on lines +181 to +185
if not hasattr(enum, "StrEnum"):
class StrEnum(str, enum.Enum):
pass

enum.StrEnum = StrEnum # type: ignore[attr-defined]

Choose a reason for hiding this comment

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

medium

The script specifies requires-python = ">=3.12" at the top. The enum.StrEnum class was added in Python 3.11, so this polyfill is not necessary and can be removed.

@chipp chipp merged commit c216f97 into main Jan 12, 2026
6 checks passed
Copy link
Owner Author

chipp commented Jan 12, 2026

Merge activity

  • Jan 12, 10:19 AM UTC: @chipp merged this pull request with Graphite.

@chipp chipp deleted the fix-room-ids branch February 18, 2026 08:34
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.

1 participant