Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node id detection #54

Merged
merged 11 commits into from
Jan 8, 2025
Merged

Conversation

Poikilos
Copy link
Contributor

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

@Poikilos
Copy link
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
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
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
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
1 check passed
@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