Skip to content

refactor: move color_u32/color_from_vec4 out of types.py - #14

Merged
kewde merged 1 commit into
masterfrom
refactor/move-color-helpers-out-of-types
Aug 20, 2026
Merged

refactor: move color_u32/color_from_vec4 out of types.py#14
kewde merged 1 commit into
masterfrom
refactor/move-color-helpers-out-of-types

Conversation

@kewde

@kewde kewde commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • types.py is meant to hold shared data types (TelegramSource, CemiRecord, TelegramRecord, etc.), but it also defined two imgui color-conversion helpers (color_u32, color_from_vec4) — the only use of imgui in the whole file. Anything importing types.py for a plain dataclass pulled in imgui_bundle too.
  • Moved both to a new, dependency-free knx_gui/color.py, updated the 3 actual importers (plugins/connection/plugin.py, plugins/network/ui.py, plugins/node_editor/ui.py — 2 other files flagged in Move color_u32/color_from_vec4 out of types.py #13 turned out to be false positives from grepping the raw imgui.get_color_u32 API name, not the helper).
  • types.py is now fully imgui-free.

Fixes #13

Test plan

  • uv run ruff check / ruff format --check clean
  • uv run pyright — 0 errors
  • uv run pytest — 231 passed
  • Launched the GUI, confirmed clean startup with no import errors

types.py is meant to hold shared data types (TelegramSource,
CemiRecord, etc.), but the two imgui color-conversion helpers meant
every importer pulled in imgui_bundle even for a plain dataclass.
Moved them to a new dependency-free knx_gui/color.py.

Fixes #13
@kewde
kewde merged commit 5920af1 into master Aug 20, 2026
5 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.

Move color_u32/color_from_vec4 out of types.py

1 participant