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

[amazonechocontrol] Import SmartHomeJ fork #17935

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Dec 20, 2024

Both forks have diverged a reasonable amount. Basically, I started with the SmartHomeJ fork since it is the more stable version, and has had more changes. I first resolved the thing-types.xml, in particular the thingTypeVersions, and merged the update instructions.xml - in such a way that coming from either the openHAB fork or the SmartHomeJ fork should result in the same structure. Then I made sure it compiled, resolving missing classes that were previously in smarthomej.common - using BaseDynamicCommandDescriptionProvider, and essentially re-implemented SimpleDynamicStateDescriptionProvider and ResourceUtil. Then I went through the history since the fork in openHAB, and applied individual significant commits (mostly manually, since they were almost all small, and easier to apply manually than resolve merge conflicts). "prepare for next version", "apply spotless", I18n updates, etc. commits were ignored (mvn i18n:generate-default-translations was run to make sure it was up to date, and non EN translations were fully reverted to their prior state in the openHAB fork to ensure future CrowdIn updates will work correctly). Several commits were omitted entirely, since they were either implemented orthogonally in SmartHomeJ (thermostat and humidity handlers) or no longer releveant (SmartHomeJ completely removed AccountServlet in an HTTP/2 refactor).

Note: the only breaking change coming from the SmartHomeJ fork is that the humidity channel id changed to relativeHumidity (handled by an update instruction)

@ccutrer ccutrer requested a review from mgeramb as a code owner December 20, 2024 15:33
@J-N-K
Copy link
Member

J-N-K commented Dec 20, 2024

I would prefer if you backport all changes. I just don't have time for that at the Moment. I can help if Problems occur.

@ccutrer
Copy link
Contributor Author

ccutrer commented Dec 20, 2024

Sure, I can help you with that. I still need to test my other use cases besides DnD. I'll work on the rest of them over the next two weeks. Do you prefer if I stuff it all into a single PR, or do PR per "topic" that happened in smarthomej?

Tangentially- what are your plans for the Tuya binding? I'd be happy to work on porting that into the main distro as well.

@J-N-K
Copy link
Member

J-N-K commented Dec 20, 2024

@ccutrer I think that it would be better to do single PR because some of the PR had issues that were later fixed together in another PR. What I did when backporting other changes is to just replace the openhab version with the smarthomej version, rename the directory, do a search&replace for org.smarthomej and then check fi something unwanted was reverted.

@J-N-K
Copy link
Member

J-N-K commented Dec 20, 2024

Regarding Tuya: fine with me.

@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Dec 20, 2024
@ccutrer ccutrer force-pushed the amazonechocontrol-dnd branch from 2e344cb to d361a61 Compare December 24, 2024 01:05
@ccutrer ccutrer changed the title [amazonechocontrol] Add do not disturb channel [amazonechocontrol] Import SmartHomeJ fork Dec 24, 2024
@ccutrer
Copy link
Contributor Author

ccutrer commented Dec 24, 2024

@J-N-K: okay, full binding ported in. Honestly, the hardest conflict was the README, since both sides had had significant work there. 🤞 I kept the essence of updates on both sides. I definitely kept the recent color temperature work from the openHAB side from @andrewfg. Let me know if I need to change any of the copyright/notices to better reference credit from the SmartHomeJ fork.

@J-N-K J-N-K added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Dec 25, 2024
@@ -11,3 +11,5 @@ https://www.eclipse.org/legal/epl-2.0/.
== Source Code

https://github.com/openhab/openhab-addons

Parts of this code have been forked from https://github.com/smarthomej/addons
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me.

*
* @author Jan N. Klug - Initial contribution
*/
@NonNullByDefault({})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to the reviewer: This is necessary because the eclipse compiler does not handle null annotations on records properly.

@jimtng
Copy link
Contributor

jimtng commented Jan 1, 2025

Amazing work, THANK YOU!

@lsiepel
Copy link
Contributor

lsiepel commented Jan 4, 2025

This PR seems to have many conflicts, can you fix them @ccutrer ?

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/oh-configuration-for-alexa-devices/161501/15

Both forks have diverged a reasonable amount. Basically, I started with the
SmartHomeJ fork since it is the more stable version, and has had more changes.
I first resolved the thing-types.xml, in particular the thingTypeVersions,
and merged the update instructions.xml - in such a way that coming from either
the openHAB fork or the SmartHomeJ fork should result in the same structure.
Then I made sure it compiled, resolving missing classes that were previously
in smarthomej.common - using BaseDynamicCommandDescriptionProvider, and
essentially re-implemented SimpleDynamicStateDescriptionProvider and
ResourceUtil. Then I went through the history since the fork in openHAB,
and applied individual significant commits (mostly manually, since they
were almost all small, and easier to apply manually than resolve merge
conflicts). "prepare for next version", "apply spotless", I18n updates,
etc. commits were ignored (`mvn i18n:generate-default-translations` was
run to make sure it was up to date, and non EN translations were fully
reverted to their prior state in the openHAB fork to ensure future
CrowdIn updates will work correctly). Several commits were omitted entirely,
since they were either implemented orthogonally in SmartHomeJ (thermostat
and humidity handlers) or no longer releveant (SmartHomeJ completely
removed AccountServlet in an HTTP/2 refactor).

Note: the only breaking change coming from the SmartHomeJ fork is that
  the humidity channel id changed to relativeHumidity (handled by an
  update instruction)

Co-authored-by: Jan N. Klug <[email protected]>
Co-authored-by: Tom Blum <[email protected]>
Signed-off-by: Cody Cutrer <[email protected]>
@ccutrer ccutrer force-pushed the amazonechocontrol-dnd branch from d361a61 to aeb5186 Compare January 15, 2025 04:15
@ccutrer
Copy link
Contributor Author

ccutrer commented Jan 15, 2025

This PR seems to have many conflicts, can you fix them @ccutrer ?

Fixed. It was all the files removed in this PR that had the copyright updated in main. I rebased (and updated the copyright header in the new files).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants