-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[hdpowerview] Refactor dynamic channels #11853
[hdpowerview] Refactor dynamic channels #11853
Conversation
JAR for this PR. |
c1e1d50
to
3924ec3
Compare
a8472e7
to
a44919e
Compare
a44919e
to
1a81b03
Compare
e6def1d
to
fc6fb44
Compare
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java
Show resolved
Hide resolved
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java
Show resolved
Hide resolved
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java
Show resolved
Hide resolved
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java
Show resolved
Hide resolved
...iew/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneChannelBuilder.java
Show resolved
Hide resolved
...iew/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneChannelBuilder.java
Show resolved
Hide resolved
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneGroupChannelBuilder.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneGroupChannelBuilder.java
Show resolved
Hide resolved
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneGroupChannelBuilder.java
Show resolved
Hide resolved
As mentioned in my email, I suggest to add the Hunter Douglas API pdf and your API addendum pdf files to the binding's doc folder and also add a 'Developers' chapter at the bottom of the |
Thanks for your mail, I'm currently responding. Short version here: PDF will not be included in context of this PR at least. |
fc6fb44
to
9c6a63a
Compare
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java
Outdated
Show resolved
Hide resolved
...iew/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneChannelBuilder.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneGroupChannelBuilder.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneGroupChannelBuilder.java
Outdated
Show resolved
Hide resolved
d7e0603
to
225cd29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not test the functionality because I don’t have automations, or scene groups, but the code looks good to me.
Thanks for having a look, @andrewfg. |
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
ffc6be4
to
e7a70f5
Compare
That was expected. It's resolved now.
Thanks a lot! |
The problem with the way you fixed the conflict is either I have to do a full review again :-( |
I'm really sorry about that, what happened and how can I avoid it in the future? From previous PR's I had an understanding that merging back from main is not good practice, but rebase is preferred. Is that correct? So I rebased towards main and resolved the conflicts. All commits were preserved in order to keep same history. If everything was reviewed excepts tests, why would you have to do a full review again? Conflict was resolved in first commit, which you of course cannot see. Two methods conflicted because they had new |
I think the normal process is to hand edit any file that has a merge conflict, to remove the conflict, and then just do a normal commit and push. |
But you still need to merge one way or the other to resolve the conflict. So either merge from main or rebase to main. |
This was what I recalled. |
Aha. I think it depends on the circumstances of the conflict. I think that there are basically two cases where merge conflicts can arise -- namely..
|
I think neither of those cases applied here. It wasn't "generally out of synchronization", but for two specific method signatures there was a change in each PR - method name in one and thrown exceptions in another. If I had manually picked from the other, it wouldn't compile, as my PR didn't have the new exception type. So I had to actually merge, either by rebasing or by merging main back into my branch. @lolodomo - please advice. I would prefer to not obstruct any ongoing PR reviews, but I'm not sure how in this case. I'm pretty annoyed myself when someone will be doing frequent rebases + squashing everything into a single commit, since it makes it impossible to track what changed during the review process. |
I am not at all a Git expert. The way I am doing it generally is to update my local main branch from the remote main branch and then merge my local main branch into my local work branch, and finally push my local work branch into my remote work branch. It avoids to have all the history pushed again. But in practice, I believe it does not help to identify what has changed with the merge. At least, you know that the only change since the last review was this merge. |
Correct, this gives the most detailed change tracking as history will not be manipulated and no force push is needed. However, it also makes history somewhat more complex, i.e. less clean as end result. This was my exact approach in the referenced PR when Kai requested me to rebase instead.
These were the only changes, i.e. conflict resolving: Other (first exception changed, method still not renamed):
This (first exception still not changed, method renamed):
The same for one other method which was renamed here and had exception changed in other. So to sum things up, I think I did was I needed to do, even though it somehow interfered with your review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Extract dynamic channel creation to separate classes. * Avoid double list allocations. * Add test coverage for scenarios with no channels built. * Extract common builder stuff to super class. * Fix grammar. * Reduce constructor access modifiers. * Removed unneeded this keyword for protected method. * Fix null annotation issues. Signed-off-by: Jacob Laursen <[email protected]>
* Extract dynamic channel creation to separate classes. * Avoid double list allocations. * Add test coverage for scenarios with no channels built. * Extract common builder stuff to super class. * Fix grammar. * Reduce constructor access modifiers. * Removed unneeded this keyword for protected method. * Fix null annotation issues. Signed-off-by: Jacob Laursen <[email protected]>
* Extract dynamic channel creation to separate classes. * Avoid double list allocations. * Add test coverage for scenarios with no channels built. * Extract common builder stuff to super class. * Fix grammar. * Reduce constructor access modifiers. * Removed unneeded this keyword for protected method. * Fix null annotation issues. Signed-off-by: Jacob Laursen <[email protected]> Signed-off-by: Nick Waterton <[email protected]>
* Extract dynamic channel creation to separate classes. * Avoid double list allocations. * Add test coverage for scenarios with no channels built. * Extract common builder stuff to super class. * Fix grammar. * Reduce constructor access modifiers. * Removed unneeded this keyword for protected method. * Fix null annotation issues. Signed-off-by: Jacob Laursen <[email protected]>
* Extract dynamic channel creation to separate classes. * Avoid double list allocations. * Add test coverage for scenarios with no channels built. * Extract common builder stuff to super class. * Fix grammar. * Reduce constructor access modifiers. * Removed unneeded this keyword for protected method. * Fix null annotation issues. Signed-off-by: Jacob Laursen <[email protected]> Signed-off-by: Andras Uhrin <[email protected]>
Signed-off-by: Jacob Laursen [email protected]
Fixes #11852
Refactoring after:
Changes
Test
I have been running this version for a longer period in production without any issues. All my channels (scenes, scene groups and automations) are working exactly as before the changes. This is the intention as the PR is purely refactoring not changing any behavior.