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

[Netatmo] Binding rewrite without external dependencies #12357

Merged
merged 67 commits into from
May 6, 2022

Conversation

clinique
Copy link
Contributor

@clinique clinique commented Feb 23, 2022

This rework of the Netatmo binding was initiated in order to remove external dependencies (swagger, okio, okhttp...).
It ended as a complete rework of it.

Should now be stable :

  • Station
  • Thermostat
  • Welcome Cam
  • Healthy Home coach
  • Siren
  • Connected Valves => for extensive tests now ( @Mdillman )
  • Presence Cam (bought one, should be able to test soon).

Most of work done but to be tested more :

  • Webhook
  • Smoke detector (won't be full part of it due to a bug in Netatmo API)

To be started (if someone volunteers):

  • Adding doorbell => inception ( @Novanic )

Latest testable version here.

This PR replaces PR #10831, that already replaced PR #9486

Signed-off-by: Gaël L'hopital [email protected]

@clinique
Copy link
Contributor Author

clinique commented Feb 23, 2022

Due to huge number of conflicting file I closed previous PR and restarted clean.
Updated file headers to 2022.
Updated to SNAPSHOT 3.3.0
Removall of deprecated Netatmo API initiated.

This version runs on my production system, so you should be able to test it right now. Some code cleaning still has to be done due to majors changes introduced by API evolutions.

@mdillmann, @Novanic , @robnielsen, @jlaur , @lolodomo : FYI

@clinique clinique self-assigned this Feb 23, 2022
@clinique clinique added (potentially) not backward compatible additional testing preferred The change works for the pull request author. A test from someone else is preferred though. enhancement An enhancement or new feature for an existing add-on work in progress A PR that is not yet ready to be merged labels Feb 23, 2022
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

@clinique - a few warnings to fix. Can you provide a diff between this PR and the most recent abandoned PR? This would make it easier to catch up with what happened in the meantime, since we are multiple reviewers that need to get back into this.

@jlaur

This comment was marked as resolved.

@clinique

This comment was marked as resolved.

@jlaur

This comment was marked as resolved.

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

@clinique - another review round done. Only minor findings as previous PR was already in a quite good state.

@jlaur
Copy link
Contributor

jlaur commented Mar 3, 2022

Yes, I identified this problem on token refresh. Will check but should be solved.

Cool. Solved, but not yet pushed, I assume?

@clinique - just checking: is this issue addressed in one of the commits 96563c0 and 82220e1, or are you still working on this?

@clinique
Copy link
Contributor Author

clinique commented Mar 4, 2022

Yes, I identified this problem on token refresh. Will check but should be solved.

Cool. Solved, but not yet pushed, I assume?

@clinique - just checking: is this issue addressed in one of the commits 96563c0 and 82220e1, or are you still working on this?

You can test with last version. Should be adressed.

@jlaur

This comment was marked as resolved.

@clinique

This comment was marked as resolved.

@openhab openhab deleted a comment from jlaur Mar 18, 2022
@jlaur
Copy link
Contributor

jlaur commented Mar 18, 2022

Correct syntax should be :

Perfect, thanks!

@jlaur

This comment was marked as resolved.

@lolodomo
Copy link
Contributor

lolodomo commented May 6, 2022

PR submitted that fixes the issue. I will run the test again.

@lolodomo
Copy link
Contributor

lolodomo commented May 6, 2022

Regarding the automatic computation of the refresh interval for the weather station, the result is a little strange, sometimes the binding computes 10 minutes, sometimes 5 minutes. This is probably not something new so not something that should delay the merge but definitively something to analyse more in details. Maybe the station is not always pushing at the same frequency ?

@lolodomo
Copy link
Contributor

lolodomo commented May 6, 2022

I had the intention yesterday to test few other channels like known and unknown persons on the home thing but my camera is no more able to detect persons (it detects movements but not persons) so I forgive.
So, to be clear, on my side, as soon as @clinique will merge my last submitted PR, I will approve this PR.
@jlaur: can you also approve it or at least tell me if you do not approve it ?
I read that there would be a potential Milestone 5 in preparation this weekend. If this is true, this would be excellent if the PR could be included in this new milestone.

conf-error-no-username = Cannot connect to Netatmo bridge as no username is available in the configuration
conf-error-no-password = Cannot connect to Netatmo bridge as no password is available in the configuration
status-bridge-offline = Bridge is not connected to Netatmo API
device-not-connected = Device is not connected
Copy link
Contributor

Choose a reason for hiding this comment

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

Quite minor, but could this be rephrased to:

Suggested change
device-not-connected = Device is not connected
device-not-connected = Device is not reachable

or is it used in more than this exact scenario? Is it always a module (additional indoor/outdoor)? In this case it could even be "Module is not reachable".

Copy link
Contributor Author

@clinique clinique May 6, 2022

Choose a reason for hiding this comment

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

Devices and modules are Netatmo wording. I prefer use Thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

I should wait for a new submit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You just received it !

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

Thanks a lot to @clinique for this massive overhaul of the binding. Also kudos to @lolodomo for joining the review in multiple iterations and helping a lot to improve the quality by review, testing and contributions.


private Duration dataValidity;
private Instant dataTimeStamp = Instant.now();
private @Nullable Instant dataTimeStamp0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps Instant.MIN could be used to avoid @Nullable. @lolodomo - consider for your pending PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Refresh strategy fixed when thing is OFFLINE
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

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

LGTM, thank you Gaël

@clinique
Copy link
Contributor Author

clinique commented May 6, 2022

Thanks a lot to @clinique for this massive overhaul of the binding. Also kudos to @lolodomo for joining the review in multiple iterations and helping a lot to improve the quality by review, testing and contributions.

Yes, big thank you for helping me finalizing this nearly two years journey ! Great help from your detailed review, tests, PRs...I was a bit exhausted and you gave me energy.

@mdillmann, @Novanic , @robnielsen, @jlaur , @lolodomo : kudos !

@lolodomo
Copy link
Contributor

lolodomo commented May 6, 2022

[INFO] --- sat-plugin:0.12.0:report (sat-all) @ org.openhab.binding.netatmo ---
[INFO] Individual report appended to summary report.
[ERROR] Code Analysis Tool has found:
 1 error(s)!
 8 warning(s)
 0 info(s)
[ERROR] org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.java:[105]

Signed-off-by: clinique <[email protected]>
@lolodomo lolodomo merged commit adda4c8 into openhab:main May 6, 2022
@lolodomo lolodomo added this to the 3.3 milestone May 6, 2022
@clinique clinique deleted the NetatmoOH33 branch May 6, 2022 22:39
@lolodomo
Copy link
Contributor

lolodomo commented May 6, 2022

@clinique : please add an entry in file distributions/openhab/src/main/resources/bin/update.lst (openhab-distro) to mention the breaking change.
And ideally prepare a short chapter that Kai could include in the future release notes.

@lolodomo
Copy link
Contributor

lolodomo commented May 6, 2022

End of a long story ;)
Now you can look at the new authentication method ;)

@lolodomo
Copy link
Contributor

lolodomo commented May 6, 2022

And thank you for your patience on this PR.

@clinique
Copy link
Contributor Author

clinique commented May 6, 2022

And thank you for your patience on this PR.

We all have been patient.

@jlaur jlaur changed the title [Netatmo] Binding rewrite without external dependencies - step 3 [Netatmo] Binding rewrite without external dependencies May 7, 2022
@kaikreuzer
Copy link
Member

@clinique : please add an entry in file distributions/openhab/src/main/resources/bin/update.lst (openhab-distro) to mention the breaking change.

Would be awesome, if you could do that by tonight as we are planning to do the M5 build today and we will need to warn people about that change.

@lolodomo
Copy link
Contributor

lolodomo commented May 7, 2022

And we will have to clean up Crowdin for different translations and fill new translations. Not necessarily today :)

@lolodomo
Copy link
Contributor

lolodomo commented May 7, 2022

And we will have to clean up Crowdin for different translations and fill new translations. Not necessarily today :)

Clean up was done apparently automatically in French and German translations. We just have to create new ones.

@clinique
Copy link
Contributor Author

clinique commented May 7, 2022

@clinique : please add an entry in file distributions/openhab/src/main/resources/bin/update.lst (openhab-distro) to mention the breaking change.

Would be awesome, if you could do that by tonight as we are planning to do the M5 build today and we will need to warn people about that change.

PR pushed. I'm not used to push against this repo, hope it is fine...

@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/netatmo-thermostat/114729/58

andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
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 (potentially) not backward compatible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants