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

Potential code generation changes. #215

Open
anschweitzer opened this issue Oct 27, 2023 · 0 comments
Open

Potential code generation changes. #215

anschweitzer opened this issue Oct 27, 2023 · 0 comments

Comments

@anschweitzer
Copy link
Collaborator

This issue lists changes that might simplify use of code generation. These are open for discussion and/or experimentation.

  1. Place all enum code in one file, not in each component/cac (if feasible).
  2. Make enums use text in the HardwareLayout. We want to retain the explicitness of a selected an enum text associated with a specific unique identifier. We want to add readability in the hardware layout. Options include:
    1. Use small digital numbers (1, 2 etc...). Experience has shown these are much or easy to recognize and remember than randomly generated hex numbers and if we can assume control of the source of truth, which is probably required anyway, are no less secure than randomly generated numbers.
    2. Use updated version of python that will support bidirectional mapping of text to value by the enum class and allow uniqueness enforcement (in python)
    3. Keep a local mapping in the hardware layout so that within in a context in which the hardware layout is verified the text can be used.
    4. Digitally sign the hardware layout so we know that mapping is reliable within the hardware layout.
  3. CACs and Components can be be implicitly decoded, as shown by:
  4. Remove most _Maker classes in favor of from_data_class() and to_data_class() functions on the relevant class, which should require substantially fewer lines and better locality that the Maker code. We still have the option to use Makers when the simple conversion functions aren't sufficient.
  5. Consider moving data_class classes into same module as 'types' class. If this is in fact feasible it would remove mental load of tracking multiple files, better locate the relevant versions of the object and potentially remove issues with cyclic import that require otherwise require additional files to be created.
anschweitzer added a commit that referenced this issue Oct 31, 2023
This PR adds support for Tank modules accessed by sending HTTP polls to a Hubitat which is configured to communicate with Fibaro Smart Implant temperature sensors on the tank via Fibaro / Hubitat ZWave network. 

Changes: 
1. New CACS, Components and enums added for Fibaro Smart Implant, Hubitat, Hubitat Tank Module and generic RESTPoller. 
2. HardwareLayout has been modified: 
    1. Components and CACS in OtherComponents/OtherCACs can be decoded from TypeName without need to specify the decoding class. 
    2. A "resolve" phase has been added after loading CACs, Components and Nodes to allow validation of relationships between entities when that validation requires all CACs, Components and Nodes to have been decoded. 
3. Code generation has been broken by this merge. Fixing up code generation will be addressed by #214. More code generation discussion in #215.
anschweitzer added a commit that referenced this issue Oct 31, 2023
Tank Module via HTTP/Hubitat/Fibaro (#205)

This PR adds support for Tank modules accessed by sending HTTP polls to a Hubitat which is configured to communicate with Fibaro Smart Implant temperature sensors on the tank via Fibaro / Hubitat ZWave network. 

Changes: 
1. New CACS, Components and enums added for Fibaro Smart Implant, Hubitat, Hubitat Tank Module and generic RESTPoller. 
2. HardwareLayout has been modified: 
    1. Components and CACS in OtherComponents/OtherCACs can be decoded from TypeName without need to specify the decoding class. 
    2. A "resolve" phase has been added after loading CACs, Components and Nodes to allow validation of relationships between entities when that validation requires all CACs, Components and Nodes to have been decoded. 
3. Code generation has been broken by this merge. Fixing up code generation will be addressed by #214. More code generation discussion in #215.
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

No branches or pull requests

1 participant