refactor: split types.py into device.py, net.py, and network/records.py - #15
Merged
kewde merged 1 commit intoAug 20, 2026
Conversation
types.py had become a grab-bag: the device/com-object domain model (Device, ComObject, ComObjectFlags, PinDir, PinRow...), dispatch-chain vocabulary shared across connection/network/proxy/virtual (TelegramSource), and network-capture-specific display records (CemiRecord, TelegramRecord) all lived in one file with no clear ownership. - knx_gui/device.py: the device/com-object domain model. Kept together rather than split further, since Device.rows depends directly on PinRow/generate_rows - splitting those into plugins/node_editor/ would have made a top-level domain type depend on a specific UI plugin. - knx_gui/net.py: TelegramSource (joins Peer from the in-progress pcap capture branch - both are dispatch-chain plumbing shared by the same set of plugins). - knx_gui/plugins/network/records.py: CemiRecord, TelegramRecord - exclusively consumed by the network plugin. Also dropped is_default_flags/listen_obj/send_obj/bidirectional_obj - confirmed dead code (defined, never called anywhere in the app).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #14 — targets that branch instead of
mastersince it continues the same cleanup; merge #14 first, then retarget/merge this one.types.pyhad become a grab-bag with three genuinely unrelated concerns living in one file with no clear ownership:knx_gui/device.py— the device/com-object domain model (Device,ComObject,ComObjectFlags,PinDir,PinRow,generate_rows, etc.). Kept together as one module rather than split further:Device.rowscallsgenerate_rows/PinRowdirectly, so splitting those intoplugins/node_editor/would've made a top-level domain type depend on a specific UI plugin — the same backwards-dependency problem already being avoided elsewhere in this codebase.knx_gui/net.py—TelegramSource, the dispatch-chain source tag shared byconnection/network/proxy/virtual. (Will end up alongsidePeeronce the in-progress pcap-capture branch merges — same category of thing, used by the same set of files.)knx_gui/plugins/network/records.py—CemiRecord,TelegramRecord. Exclusively consumed by thenetworkplugin, so plugin-local scope fits.Also removed
is_default_flags/listen_obj/send_obj/bidirectional_obj— confirmed dead code (defined, never called anywhere in the app).Test plan
uv run ruff check/ruff format --checkcleanuv run pyright— 0 errors (note: doesn't actually coverapps/knx-gui, scoped topackages/*only)uv run pytest— 231 passedDevice/ComObjectcode path directly