Skip to content

Draw room labels from bbox center when pos or name is missing - #15

Open
jonatanjacobsson wants to merge 1 commit into
PiotrMachowski:masterfrom
jonatanjacobsson:draw-room-labels-bbox-center
Open

jonatanjacobsson wants to merge 1 commit into
PiotrMachowski:masterfrom
jonatanjacobsson:draw-room-labels-bbox-center

Conversation

@jonatanjacobsson

Copy link
Copy Markdown

Summary

  • Room.point() uses explicit pos_x/pos_y when both are set; otherwise it returns the bounding-box center. A name is no longer required for a label position.
  • _draw_room_names draws room.name when present and falls back to str(room.number). It still skips only when point() is None.

Roborock, Dreame, and Viomi parsers omit pos_* and/or name, so Room.point() previously returned None and room labels never appeared on generated maps. Dreame already sets names but still did not draw because point() also required pos_x/pos_y.

Test plan

  • Code quality CI (black, isort, pylint, mypy) passes
  • Room with both pos_x/pos_y still labels at the explicit position
  • Room with only a bbox (Roborock/Viomi) labels at the bbox center using the room number
  • Room with a name but no pos (Dreame) labels at the bbox center using the name

Made with Cursor

Roborock, Dreame, and Viomi omit those fields, so labels never drew.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

2 participants