Skip to content

Parse semantics ids for channels and group objects#603

Open
farmio wants to merge 4 commits intomainfrom
semantics
Open

Parse semantics ids for channels and group objects#603
farmio wants to merge 4 commits intomainfrom
semantics

Conversation

@farmio
Copy link
Copy Markdown
Member

@farmio farmio commented Mar 16, 2026

This parses functional blocks ("knx:fb") of device channels and DPAs ("knx:dpa") of group objects as strings.

cc @ richardpolzer

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request extends the KNX project parsing pipeline to extract additional semantic metadata from application program XML and expose it in the parsed project output.

Changes:

  • Parse Semantics attributes for Channels (functional blocks) and ComObjectRefs (DPAs) in the application program loader.
  • Propagate parsed semantics into internal models and into the final KNXProject output structure.
  • Update JSON stubs to include the new output fields (dpas, functional_blocks).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
xknxproject/xml/parser.py Adds dpas and functional_blocks to the final transformed output.
xknxproject/util.py Introduces helpers to parse semantic functional blocks and DPAs from XML Semantics.
xknxproject/models/models.py Adds model fields and wiring to carry semantics through merging/resolution.
xknxproject/models/knxproject.py Extends output TypedDicts with dpas and functional_blocks.
xknxproject/loader/application_program_loader.py Parses Semantics for channels and com object refs during XML load.
test/resources/stubs/*.json Updates expected parsed-project stubs with the new fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 95.12195% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.51%. Comparing base (e19af03) to head (915c6b2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
xknxproject/models/models.py 85.71% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #603      +/-   ##
==========================================
+ Coverage   95.17%   96.51%   +1.34%     
==========================================
  Files          22       22              
  Lines        1284     1320      +36     
==========================================
+ Hits         1222     1274      +52     
+ Misses         62       46      -16     
Files with missing lines Coverage Δ
xknxproject/loader/application_program_loader.py 100.00% <100.00%> (ø)
xknxproject/models/knxproject.py 100.00% <100.00%> (ø)
xknxproject/util.py 97.29% <100.00%> (+1.29%) ⬆️
xknxproject/xml/parser.py 93.38% <ø> (ø)
xknxproject/models/models.py 95.57% <85.71%> (+3.92%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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