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] Consider TimeZoneProvider #7894

Merged
merged 3 commits into from
Jun 11, 2020

Conversation

lolodomo
Copy link
Contributor

Signed-off-by: Laurent Garnier lg.hc@free.fr

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@TravisBuddy
Copy link

Travis tests were successful

Hey @lolodomo,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@@ -39,13 +40,20 @@
@NonNullByDefault
public class ChannelTypeUtils {

private static @Nullable TimeZoneProvider timeZoneProvider;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure I'm comfortable with adding static variables if you don't have to. But I can see why you would want to.
@J-N-K What is your opinion on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can avoid it but I should then pass TimeZoneProvier as parameter to a lot of handler classes.
If you prefer, I can do it.
Note that the astro binding uses this way with the global variable.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@TravisBuddy
Copy link

Travis tests were successful

Hey @lolodomo,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@TravisBuddy
Copy link

Travis tests were successful

Hey @lolodomo,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@lolodomo
Copy link
Contributor Author

As you can see, to avoid the global variable, it required many more changes.

Note that I have not tested the changes.

Copy link
Contributor

@cpmeister cpmeister left a comment

Choose a reason for hiding this comment

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

LGTM

@cpmeister
Copy link
Contributor

Yeah, sorry about having you go through that. Static fields can make some things so much more convenient but they can also cause unforeseen problems in what should be a modular environment. Thank you.

@cpmeister cpmeister merged commit 9b494e4 into openhab:2.5.x Jun 11, 2020
@cpmeister cpmeister added the enhancement An enhancement or new feature for an existing add-on label Jun 11, 2020
@cpmeister cpmeister added this to the 2.5.6 milestone Jun 11, 2020
@lolodomo lolodomo deleted the netatmo_timezoneprovider branch June 12, 2020 16:11
knikhilwiz pushed a commit to knikhilwiz/openhab2-addons that referenced this pull request Jul 12, 2020
* [netatmo] Consider TimeZoneProvider
* Add a @nullable
* Avoid storing timeZoneProvider in a static variable

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
* [netatmo] Consider TimeZoneProvider
* Add a @nullable
* Avoid storing timeZoneProvider in a static variable

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: CSchlipp <christian@schlipp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [netatmo] Consider TimeZoneProvider
* Add a @nullable
* Avoid storing timeZoneProvider in a static variable

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [netatmo] Consider TimeZoneProvider
* Add a @nullable
* Avoid storing timeZoneProvider in a static variable

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [netatmo] Consider TimeZoneProvider
* Add a @nullable
* Avoid storing timeZoneProvider in a static variable

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [netatmo] Consider TimeZoneProvider
* Add a @nullable
* Avoid storing timeZoneProvider in a static variable

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
* [netatmo] Consider TimeZoneProvider
* Add a @nullable
* Avoid storing timeZoneProvider in a static variable

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Daan Meijer <daan@studioseptember.nl>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
* [netatmo] Consider TimeZoneProvider
* Add a @nullable
* Avoid storing timeZoneProvider in a static variable

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
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.

3 participants