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

[tado] Add channel for PresenceState and support setting HOME/AWAY #8868

Merged
merged 1 commit into from
Oct 29, 2020

Conversation

Pro
Copy link
Contributor

@Pro Pro commented Oct 26, 2020

[tado] Add channel for PresenceState and support setting HOME/AWAY

This PR adds the support for reading the Tado Home Presence State (HOME/AWAY) and adds support for changing the HOME/AWAY state through OpenHAB.
Closes #8826

Rebase of #8854 onto main branch.

@wborn I'm not the original author of this bundle. Therefore, I'm not sure how to get the additional api-client artifact to be built. Also I'm not a Maven expert... The pom.xml is in the src/main/api dir and I could only test the new bundle version when manually compiling the api. Can you push it to the openhab maven repo?

@wborn
Copy link
Member

wborn commented Oct 26, 2020

Can you push it to the openhab maven repo?

I don't have these permissions but maybe @J-N-K build and uploaded the previous version in #7006.

@Pro
Copy link
Contributor Author

Pro commented Oct 26, 2020

Maybe also @andrewfg could help, updating the api-client package?

@J-N-K
Copy link
Member

J-N-K commented Oct 26, 2020

Done

@andrewfg
Copy link
Contributor

image

@wborn @J-N-K @Pro => I'm not sure if you need me to do anything more ?? => please let me know.

@J-N-K J-N-K added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Oct 26, 2020
@Pro
Copy link
Contributor Author

Pro commented Oct 26, 2020

I'm not sure what caused Jenkins to fail. I cannot really find an error output somewhere.

@J-N-K
Copy link
Member

J-N-K commented Oct 26, 2020

The dependency-not-found result from the previous build was cached. This takes some time.

@J-N-K J-N-K added enhancement An enhancement or new feature for an existing add-on rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Oct 27, 2020
@J-N-K J-N-K changed the title [tado] Add channel for PresenceState and support setting HOME/AWAY. Fixes #8826 [tado] Add channel for PresenceState and support setting HOME/AWAY Oct 27, 2020
@Pro
Copy link
Contributor Author

Pro commented Oct 27, 2020

Seems the api-client maven is still not updated:

Build output:

Failure to find org.openhab.binding.tado:api-client:jar:1.4.1

@andrewfg
Copy link
Contributor

Seems the api-client maven is still not updated:

Hmm. It is definitely in the bintray but maybe you need to check the naming in your pom dependency?

@Pro
Copy link
Contributor Author

Pro commented Oct 27, 2020

If I build it locally, it works (i.e., first mvn install in the api folder, then mvn install in the binding folder).
So I guess the naming should be correct.

@andrewfg
Copy link
Contributor

Then it beats me; I guess @J-N-K needs to respond.

@J-N-K J-N-K added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Oct 28, 2020
@J-N-K
Copy link
Member

J-N-K commented Oct 28, 2020

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.0.3:check (codestyle_check) on project org.openhab.binding.tado: The following files had format violations:
[ERROR] src/main/java/org/openhab/binding/tado/internal/handler/TadoHomeHandler.java
[ERROR] @@ -157,10 +157,9 @@
[ERROR] ········switch·(id)·{
[ERROR] ············case·TadoBindingConstants.CHANNEL_HOME_PRESENCE_MODE:
[ERROR] ················HomePresence·presence·=·new·HomePresence();
[ERROR] -················presence.setHomePresence(
[ERROR] -························command.toFullString().toUpperCase().equals("ON")·||
[ERROR] -································command.toFullString().toUpperCase().equals("HOME")·?
[ERROR] -································PresenceState.HOME·:·PresenceState.AWAY);
[ERROR] +················presence.setHomePresence(command.toFullString().toUpperCase().equals("ON")
[ERROR] +························||·command.toFullString().toUpperCase().equals("HOME")·?·PresenceState.HOME
[ERROR] +································:·PresenceState.AWAY);
[ERROR] ················try·{
[ERROR] ····················api.updatePresenceLock(homeId,·presence);
[ERROR] ················}·catch·(IOException·|·ApiException·e)·{
[ERROR] Run 'mvn spotless:apply' to fix these violations.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :org.openhab.binding.tado

Please run mvn spotless:apply -pl :org.openhab.binding.tado

The new bundle is now correctly picked up.

…ixes openhab#8826

Signed-off-by: Stefan Profanter <pro@users.noreply.github.com>
@Pro
Copy link
Contributor Author

Pro commented Oct 29, 2020

I updated the PR with the spotless fixes, but now CI fails again:

Failed to execute goal on project org.openhab.binding.tado: Could not resolve dependencies for project org.openhab.addons.bundles:org.openhab.binding.tado:jar:3.0.0-SNAPSHOT: Failure to find org.openhab.binding.tado:api-client:jar:1.4.1 in https://openhab.jfrog.io/openhab/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of openhab-release has elapsed or updates are forced -> [Help 1]

@J-N-K J-N-K added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Oct 29, 2020
@J-N-K
Copy link
Member

J-N-K commented Oct 29, 2020

If this still does not work, I'll try to build locally and override Jenkins if that succeeds.

@J-N-K
Copy link
Member

J-N-K commented Oct 29, 2020

Build succeeds locally and library can be resolved. Must be some sort of caching issue.

@Pro Pro deleted the tado_presence_3 branch October 29, 2020 17:36
nowaterman pushed a commit to nowaterman/openhab-addons that referenced this pull request Jan 19, 2021
boehan pushed a commit to boehan/openhab-addons that referenced this pull request Apr 12, 2021
…ixes openhab#8826 (openhab#8868)

Signed-off-by: Stefan Profanter <pro@users.noreply.github.com>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
…ixes openhab#8826 (openhab#8868)

Signed-off-by: Stefan Profanter <pro@users.noreply.github.com>
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.

[tado] Add Home/Away setting to be writable
4 participants