Skip to content

Conversation

@sca075
Copy link
Owner

@sca075 sca075 commented Oct 14, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a room names mapping that lists up to 16 rooms as “SegmentID: RoomName,” enabling clearer room identification across interfaces and exports.
  • Chores
    • Updated release version to 0.1.11.

sca075 and others added 20 commits October 2, 2025 18:18
…ean tested for rand.

Signed-off-by: Sandro Cantarella <sandro@Sandros-Mac-mini.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@Sandros-Mac-mini.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@Sandros-Mac-mini.fritz.box>
…unction with C based from mcvrender.

Signed-off-by: Sandro Cantarella <sandro@509dc541-f930-4e46-87da-4482e9d9a7bb.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@13de464c-e6f5-4665-b8d7-d6acf4207b24.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@13de464c-e6f5-4665-b8d7-d6acf4207b24.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@Sandros-Mac-mini.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@Sandros-Mac-mini.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@03829bc9-740a-4ae1-9848-e7d8baa7c8ba.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@e12ecfb7-0503-4719-87b7-0b014abdffa8.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@Sandros-Mac-mini.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@cabf9afe-642b-4ef6-b6d4-34d9c877830b.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@cabf9afe-642b-4ef6-b6d4-34d9c877830b.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@1b7a9c0c-b720-40e5-a6c3-7b3a28793b2e.fritz.box>
@sca075 sca075 self-assigned this Oct 14, 2025
@sca075 sca075 added the enhancement New feature or request label Oct 14, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 14, 2025

Walkthrough

Adds a computed property room_names to RoomStore in SCR/valetudo_map_parser/config/types.py to expose a mapping of room identifiers to names, capped at 16 entries. Also updates package version in pyproject.toml from 0.1.11b1 to 0.1.11.

Changes

Cohort / File(s) Summary
Config types update
SCR/valetudo_map_parser/config/types.py
Added RoomStore.room_names property generating a dict like {"room_{idx}_name": "SegmentID: RoomName"} from vacuums_data, defaulting names when absent; no changes to existing methods.
Version bump
pyproject.toml
Updated version from 0.1.11b1 to 0.1.11; no other configuration changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my nose at tidy rooms, hooray!
New names hop in, in carrot-bright array.
Sixteen burrows mapped, neat as can be—
Segment, title, labeled for me.
Version nibbles up a minor rung,
Thump-thump! The changelog’s softly sung. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and succinctly describes the primary change—adding room names support to the RoomStore class—and aligns directly with the changeset summary without extraneous details. It is concise, specific, and will help teammates understand the main enhancement at a glance.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
SCR/valetudo_map_parser/config/types.py (1)

126-127: Add type hints for improved clarity.

The return type annotation dict can be more specific as dict[str, str] to clarify that both keys and values are strings.

Apply this diff to add precise type hints:

     @property
-    def room_names(self) -> dict:
+    def room_names(self) -> dict[str, str]:
         """Return room names in format {'room_0_name': 'SegmentID: RoomName', ...}."""
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e15b146 and 8f4b91b.

📒 Files selected for processing (2)
  • SCR/valetudo_map_parser/config/types.py (1 hunks)
  • pyproject.toml (1 hunks)
🔇 Additional comments (2)
pyproject.toml (1)

3-3: LGTM! Standard beta-to-release version bump.

The version bump from 0.1.11b1 to 0.1.11 appropriately reflects the transition from beta to a stable release.

SCR/valetudo_map_parser/config/types.py (1)

126-136: Guard vacuums_data access with a lock. set_rooms() (lines 117–118) mutates self.vacuums_data without synchronization, and room_names (lines 126–136) reads it unsafely. Confirm there are no concurrent access patterns, or protect both with RoomStore._lock.

Comment on lines +131 to +135
for idx, (segment_id, room_data) in enumerate(self.vacuums_data.items()):
if idx >= 16: # Max 16 rooms
break
room_name = room_data.get("name", f"Room {segment_id}")
result[f"room_{idx}_name"] = f"{segment_id}: {room_name}"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add defensive check for room_data structure.

If room_data is not a dictionary (e.g., None, string, or other type), line 134 will raise an AttributeError when calling .get(). While the vacuums_data dict is expected to contain dict values, adding a defensive check improves robustness.

Apply this diff to add a type check:

         if isinstance(self.vacuums_data, dict):
             for idx, (segment_id, room_data) in enumerate(self.vacuums_data.items()):
                 if idx >= 16:  # Max 16 rooms
                     break
-                room_name = room_data.get("name", f"Room {segment_id}")
+                if isinstance(room_data, dict):
+                    room_name = room_data.get("name", f"Room {segment_id}")
+                else:
+                    room_name = f"Room {segment_id}"
                 result[f"room_{idx}_name"] = f"{segment_id}: {room_name}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for idx, (segment_id, room_data) in enumerate(self.vacuums_data.items()):
if idx >= 16: # Max 16 rooms
break
room_name = room_data.get("name", f"Room {segment_id}")
result[f"room_{idx}_name"] = f"{segment_id}: {room_name}"
if isinstance(self.vacuums_data, dict):
for idx, (segment_id, room_data) in enumerate(self.vacuums_data.items()):
if idx >= 16: # Max 16 rooms
break
if isinstance(room_data, dict):
room_name = room_data.get("name", f"Room {segment_id}")
else:
room_name = f"Room {segment_id}"
result[f"room_{idx}_name"] = f"{segment_id}: {room_name}"
🤖 Prompt for AI Agents
In SCR/valetudo_map_parser/config/types.py around lines 131 to 135, the loop
assumes room_data is a dict and calls room_data.get(...), which can raise
AttributeError if room_data is None or another type; add a defensive type check
(e.g., if not isinstance(room_data, dict) then treat room_name as a fallback
like str(room_data) or use a default name) before calling .get(), preserve the
existing early-break at 16 rooms, and ensure result[f"room_{idx}_name"] is
always assigned a safe string.

@sca075 sca075 merged commit c7977c9 into main Oct 14, 2025
3 checks passed
This was referenced Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants