Extract drivers boilerplate code to common#115
Merged
jtebbens merged 3 commits intojtebbens:masterfrom Mar 30, 2025
Merged
Conversation
Owner
|
Ok, I understand the reason. It has grown this way when one by one these hardware devices found the market. I will have a look and merge the code. |
Author
|
Nice! I want to add the same type of flow for v1, but that would mean tweaking 5 drivers which feels like a landmine 😇. This feels like a nice step in between :) |
Owner
|
Ok merged, you might have noticed that I aligned the PIB pairing with P1. |
Author
|
Yeah that was awesome, thanks for that 🎉 |
This was referenced Mar 30, 2025
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.
The API for HomeWizard energy is the same so lot of code can be reused.
This PR moves the driver of v1 and v2 devices into a
commonfolder so they can be reused. We can keep all the code changes for all drivers at one location, instead of keeping them updated one-by-one. No logic changes in this PR, only moved some codeFor now it does not seem we need unique logic per device, if we need that we can see how we can fix that.
One small drawback: This removes the 'model name' of the P1 Meter during config. It now just shows the serial ID. I don't think this is a big issue.