Skip to content

Node id detection#54

Merged
bobjacobsen merged 11 commits intobobjacobsen:mainfrom
Hierosoft:node-id-detection
Jan 8, 2025
Merged

Node id detection#54
bobjacobsen merged 11 commits intobobjacobsen:mainfrom
Hierosoft:node-id-detection

Conversation

@Poikilos
Copy link
Copy Markdown
Contributor

This may require discussion, unless you are ok with implementing conventions (as in module features that are a superset of standards).

Comment thread openlcb/__init__.py
Comment thread openlcb/tcplink/mdnsconventions.py
@Poikilos
Copy link
Copy Markdown
Contributor Author

Poikilos commented Dec 29, 2024

  • Added unified function (validate_lcc_id) which handles conversion to hex as well so that there can be a single piece of code that handles the convention (can be used for either validation or conversion to hex or both).
    • Allows elements without zero padding.
      • Adding the function (and related comments and tests for that and only_hex_pairs) also makes that lenience an explicit convention.
  • moved conversion from hex to dot notation to new conventions.py (hex_to_dotted_lcc_id)

…ed if using dot notation in new form validation function, and add tests.
…ke "get" method to settings. Rename "text" to "caption" so text of widget itself can be set (since Checkbutton has an integrated text field).
@Poikilos
Copy link
Copy Markdown
Contributor Author

Poikilos commented Jan 7, 2025

If you could, please make sure the docstring in 2e2e77a is correct, especially control, and the comment under nodeCode =.

@Poikilos
Copy link
Copy Markdown
Contributor Author

Poikilos commented Jan 7, 2025

Also, is 4b94c25 correct, or are partial (right a.k.a. more local side) IDs allowed in dot notation?

  • or is there some reason to allow silently degrading to 0 here--I didn't think so since in the case of dot notation we are dealing with user-entered data not packets.

@bobjacobsen
Copy link
Copy Markdown
Owner

If you could, please make sure the docstring in 2e2e77a is correct, especially control, and the comment under nodeCode =.

Looks good to me. The mask was written as 0x10_000_000 because the CAN fields are 12 bits each, but changing it to 0x10_00_00_00 definitely makes it easier to read.

Also, is 4b94c25 correct, or are partial (right a.k.a. more local side) IDs allowed in dot notation?

or is there some reason to allow silently degrading to 0 here--I didn't think so since in the case of dot notation we are dealing with user-entered data not packets.

I think this is fine. Thanks for making the change.

@bobjacobsen bobjacobsen merged commit 41837c4 into bobjacobsen:main Jan 8, 2025
@Poikilos Poikilos deleted the node-id-detection branch January 10, 2025 14:24
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