Skip to content

fix(rooms): let a name that differs only in case update the room's spelling - #272

Open
kris-anderson wants to merge 1 commit into
Python-roborock:mainfrom
kris-anderson:fix/room-name-case
Open

kris-anderson wants to merge 1 commit into
Python-roborock:mainfrom
kris-anderson:fix/room-name-case

Conversation

@kris-anderson

Copy link
Copy Markdown
Contributor

Fixes #271

upsert_inventory_room matches an existing room ignoring case so a room isn't created twice, but it returned and kept the stored spelling. A rename that only changes capitals, such as "Master bedroom" to "Master Bedroom", came back unchanged, and no other route renames a room.

Change

  • When the name matches an existing room ignoring case, the room takes the new spelling and the response returns it. The id stays the same and created stays false, so segments that already point at the room keep working.

Testing

  • New test test_create_room_with_new_capitalization_updates_existing_room: fails on main, passes with this change.
  • uv run pytest -q: 486 passed.

🤖 Generated with Claude Code

…elling

upsert_inventory_room matches an existing room ignoring case so a room isn't created twice, but it returned and kept the stored spelling, so a rename that only changes capitals came back unchanged. Store the new spelling on the matched room; its id and created=false stay the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 17, 2026 00:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the change enabling case-only room renames.

No open issues 🎉

What changed in this PR

Fixes #271 by allowing case-only room name changes through the existing room creation endpoint, while preserving the room’s ID and existing segment references.

Changes:

  • Store and return the requested capitalization when an existing room matches ignoring case, keeping created: false.
  • Add a regression test covering the response and persistence in both inventory room lists.
File Description
tests/​test_admin_api.py Tests case-only renaming, stable room ID, and persisted spelling.
src/​roborock_local_server/​bundled_backend/​https_server/​routes/​user/​homes/​service.py Updates an existing room’s spelling on a case-insensitive match.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

Renaming a room so only its capitals change keeps the old spelling

2 participants