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

[panamaxfurman] Initial contribution #12895

Closed
wants to merge 1 commit into from
Closed

Conversation

dbadia
Copy link

@dbadia dbadia commented Jun 5, 2022

New binding for Panamax/Furman power conditioners which have the BlueBOLT-CV1 or BlueBOLT-CV2 interface card installed

Precompiled binary available here
https://github.com/dbadia/openhab-panamaxfurman-compiled

@dbadia dbadia requested a review from a team as a code owner June 5, 2022 22:28
…BOLT-CV1 or BlueBOLT-CV2 interface card installed

Signed-off-by: Dave Badia <dbadia@gmail.com>
@jlaur jlaur added the new binding If someone has started to work on a binding. For a new binding PR. label Jun 6, 2022
Copy link
Contributor

@lsiepel lsiepel 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 the PR!
As i'm a beginner reviewer do not take this as a full review. Some other reviewer will probably pick this up for a more extensive review.

I noticed the logging is not always been used as described in: https://www.openhab.org/docs/developer/guidelines.html#f-logging. There is also alot of inline comment.
There are also some SAT errors that need attention.


The Telnet interface was chosen for implementation due to the following:

* Telnet interface supports "push" notifications from the device which provide instant and more reliable status information as opposed to repetitive polling of state as required by the HTTP interface
Copy link
Contributor

Choose a reason for hiding this comment

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

Please put the 'feature' part if this text to the top of this file to the summary of this binding. It is not needed to explain to end-users about who this or that protocol is used. That is more a technical perspective.

## Notes

The Panamax/Furamn Power Conditioner devices actually support 3 different protocols:
| Interface | Supported? | Interface Card |
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix markdown table


### `telnet` Thing Configuration

| Name | Type | Description | Default | Required | Advanced |
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix markdown table


## Channels

| Channel | Type | Read/Write | Description |
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix markdown table


## Thing Configuration

### `telnet` Thing Configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think telnet is a good name for this thing. If you ever want to switch to a different protocol (RS-232 or HTTP) this name no longer fits. I would sugggest to change it to something like 'conditioner' or whatever suits the best.

wasLastBrand = false;
// assume this is the model
if (data.trim().split(" ").length > 1) {
logger.warn("wasLastBrand was true but model had multiple parts: {}", data);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please adjust to debug

* @author Dave Badia - Initial contribution
*
*/
// Can't use @NonNullByDefault here, causes compilation errors
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe some more experienced java developer can help you out here?

@@ -0,0 +1,24 @@
binding.panamaxfurman.name = PanamaxFurman binding
binding.panamaxfurman.description = Binding for Panamax/Furman power conditioners which have the BlueBOLT-CV1 or BlueBOLT-CV2 interface card installed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the mvn command to add default translations.
some of this file are filled, some not.

</channel-group-type>

<channel-group-type id="outletControlsTelnet">
<label>Outlet Controls Telenet</label>
Copy link
Contributor

Choose a reason for hiding this comment

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

Telenet? typo i guess?

public class PanamaxFurmanOutletGenerateAndParseTest {

@ParameterizedTest
@CsvSource(value = { "1,outlet1#power", "null, blah" }, nullValues = { "null" })
Copy link
Contributor

Choose a reason for hiding this comment

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

blah?

|---------|--------|------------|-----------------------------|
| Brand | String | R | Brand of the power conditioner|
| Model | String | R | Model of the power conditioner|
| Firmware Version | String | R | Firmware version of the power conditioner|
Copy link
Contributor

@mlobstein mlobstein Jun 6, 2022

Choose a reason for hiding this comment

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

Since Brand, Model and Firmware Version are just static metadata (rather than say a voltage measurement) that will not be useful in rules, these do not need to be a channel. They can be a Thing Property instead. Here is an example of how Thing Properties look for another binding when displaying similar data:
image

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>3.3.0-SNAPSHOT</version>
Copy link
Member

@wborn wborn Jul 10, 2022

Choose a reason for hiding this comment

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

Suggested change
<version>3.3.0-SNAPSHOT</version>
<version>4.2.0-SNAPSHOT</version>

@lolodomo lolodomo added the awaiting feedback Awaiting feedback from the pull request author label Oct 19, 2022
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be adapted to the new addon.xml, the PR to adapt the developer docs is not merged yet, so if you need more details, the corresponding issue is here: openhab/openhab-core#2058
But you can also update your branch and look at another binding's addon.xml and adapt it to this initial contribution.

@dbadia
Copy link
Author

dbadia commented Dec 30, 2023

I've moved this work to a new branch on my fork. I'm going to close this PR and open a new one after I make some updates based on this feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Awaiting feedback from the pull request author 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