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

[haywardomnilogic] Hayward Omnilogic Pool Automation Binding #8338

Closed
wants to merge 45 commits into from
Closed

[haywardomnilogic] Hayward Omnilogic Pool Automation Binding #8338

wants to merge 45 commits into from

Conversation

matchews
Copy link
Contributor

Signed-off-by: Matt Myers mmyers75@icloud.com

Hayward Omnilogic binding initial contribution

The Hayward Omnilogic binding integrates the Omnilogic pool controller using the Hayward API.

@matchews matchews requested a review from a team as a code owner August 24, 2020 22:57
@TravisBuddy
Copy link

Travis tests were successful

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

1 similar comment
@TravisBuddy
Copy link

Travis tests were successful

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

@Hilbrand Hilbrand added the new binding If someone has started to work on a binding. For a new binding PR. label Aug 25, 2020
@Hilbrand Hilbrand changed the title Hayward Omnilogic Pool Automation Binding [haywardomnilogic] Hayward Omnilogic Pool Automation Binding Aug 25, 2020
@matchews
Copy link
Contributor Author

Copy link
Member

@fwolter fwolter left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I reviewed your code and here is my feedback.

To add your binding to the official distribution, you need to add your binding to bundles/pom.xml and bom/openhab-addons/pom.xml.

There are some checkstyle warnings left. You could take a look at target/code-analysis/report.html.

There are some formatting issues. You can view them with mvn spotless:check -Dspotless.check.skip=false and fix them with mvn spotless:apply.

@TravisBuddy
Copy link

Travis tests were successful

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

2 similar comments
@TravisBuddy
Copy link

Travis tests were successful

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

@TravisBuddy
Copy link

Travis tests were successful

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

@fwolter
Copy link
Member

fwolter commented Sep 2, 2020

This was a general Jenkins issue, which has been fixed some hours ago.

@TravisBuddy
Copy link

Travis tests were successful

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

3 similar comments
@TravisBuddy
Copy link

Travis tests were successful

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

@TravisBuddy
Copy link

Travis tests were successful

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

@TravisBuddy
Copy link

Travis tests were successful

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

@fwolter
Copy link
Member

fwolter commented Sep 5, 2020

Tried running this outside of the IDE on my 2.5.4 RasPi and got the same results plus another hint in the logs:

21:47:52.984 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1969-12-31T19:00:01.000-0500' of item PoolChlorOperatingMode with format '%.0f': f != java.time.ZonedDateTime

This is really strange as you haven't configured a pattern of %.0f nor use ZonedDateTime in your code. What does the debugger say when updating the chlorOperatingMode Channel?

@TravisBuddy
Copy link

Travis tests have failed

Hey @matchews,
please read the following log in order to understand the failure reason. There might also be some helpful tips along the way.
It will be awesome if you fix what is wrong and commit the changes.

@matchews
Copy link
Contributor Author

matchews commented Sep 6, 2020

Tried running this outside of the IDE on my 2.5.4 RasPi and got the same results plus another hint in the logs:
21:47:52.984 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1969-12-31T19:00:01.000-0500' of item PoolChlorOperatingMode with format '%.0f': f != java.time.ZonedDateTime

This is really strange as you haven't configured a pattern of %.0f nor use ZonedDateTime in your code. What does the debugger say when updating the chlorOperatingMode Channel?

I can't explain why, but this is now working as intended.

Signed-off-by: matchews <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
…h thing.xml options.

Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
@fwolter
Copy link
Member

fwolter commented Sep 8, 2020

Do you request another review, when you are finished making the changes?

@matchews
Copy link
Contributor Author

matchews commented Sep 8, 2020

Do you request another review, when you are finished making the changes?

Not yet. I need to clean up the polling and also need to figure out the Jenkins failure. I'm also getting dates again in my thing.xml items with options on my rasPi working OpenHab instance, but not in the Eclipse IDE.

19:14:18.177 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1969-12-31T19:00:01.000-0500' of item PoolBackyardState with format '%.0f': f != java.time.ZonedDateTime 19:14:18.182 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1969-12-31T19:00:00.000-0500' of item PoolBOWFlow with format '%.0f': f != java.time.ZonedDateTime 19:14:18.189 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1969-12-31T19:00:00.000-0500' of item PoolFilterState with format '%.0f': f != java.time.ZonedDateTime 19:14:19.657 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1969-12-31T19:00:00.000-0500' of item PoolHeaterState with format '%.0f': f != java.time.ZonedDateTime 19:14:19.662 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1969-12-31T19:00:02.000-0500' of item PoolLightCurrentShow with format '%1f': f != java.time.ZonedDateTime 19:14:19.670 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1969-12-31T19:00:02.000-0500' of item PoolLightCurrentShow with format '%1f': f != java.time.ZonedDateTime 19:14:19.673 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1969-12-31T19:00:02.000-0500' of item PoolLightCurrentShow with format '%1f': f != java.time.ZonedDateTime

@fwolter
Copy link
Member

fwolter commented Sep 9, 2020

Sounds like some kind of caching problem on your raspi. The Jenkins build seems to fail due to a general issue.

Copy link
Member

@Hilbrand Hilbrand left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. I've reviewed the code and you'll get some homework 😉 My general comment is that all logic is in the bridge. You've created all handler subclasses, but these don't add anything. It would make it much more readable and easier to extend or follow the control flow if the device specific logic is done in the handlers. Also the bridge does the discovery, but this should be done by the discovery service, not the bridge. I've made some specific comments were things can be improved. But if you still have questions feel free to ask.

Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
@openhab-bot
Copy link
Collaborator

Automatic code migration to openHAB 3 succeeded.

The resulting code can be found at https://ci.openhab.org/job/openHAB-Addons-Migration/29/artifact/bundles/.

You can download the migrated code from there and create a new PR against the master branch of the openhab-addons repo to contribute it for being included in openHAB 3.x.

Please see this issue about the details on how to proceed with your existing PR.

@matchews
Copy link
Contributor Author

Thanks for your contribution. I've reviewed the code and you'll get some homework 😉 My general comment is that all logic is in the bridge. You've created all handler subclasses, but these don't add anything. It would make it much more readable and easier to extend or follow the control flow if the device specific logic is done in the handlers. Also the bridge does the discovery, but this should be done by the discovery service, not the bridge. I've made some specific comments were things can be improved. But if you still have questions feel free to ask.

Thanks for your time reviewing. The general comments are very logical, but I'm having a hard time determining how to implement. I'm trying to breakup the getTelemetry routine first. I was planning to pass the xml file to each thinghandler (if at least one of these thing types exist) to scan for any things of that type that exist and update them. It seems that you cannot call the thinghandler without creating an instance that is specific to a single thing. That would force me to scan through the XML in the bridgehandler and call the thinghandler once each thing is found. Not much of a gain in segregating the code out to the individual handers. Hopefully I'm missing the trivial solution here. I tried a static routine but that snowballed quickly. Any guidance you can offer would be greatly appreciated. Thanks!

@Hilbrand
Copy link
Member

It seems that you cannot call the thinghandler without creating an instance that is specific to a single thing. That would force me to scan through the XML in the bridgehandler and call the thinghandler once each thing is found.

I'm not sure what you mean by this? Why do you need to create an instance?
You can iterate over the things (getThing().getThings()) in the bridge and on each thing get the handler and pass the xml to that handler. The handler can parse the thing specific data out of the xml.

Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Matt Myers <mmyers75@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new binding If someone has started to work on a binding. For a new binding PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants