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

[lutron] Add support for bridged RadioRA (classic) systems #10302

Merged
merged 4 commits into from
Mar 31, 2021

Conversation

bobadair
Copy link
Member

@bobadair bobadair commented Mar 7, 2021

This update adds support for bridged RadioRA (classic) systems. A system is considered “bridged” when a Chronos System Bridge and Timeclock is used to integrate two RadioRA Systems in a single residence.

I also took the opportunity to add null annotations to the source files for the RadioRA part of the binding.

Signed-off-by: Bob Adair <bob.github@att.net>
Signed-off-by: Bob Adair <bob.github@att.net>
Signed-off-by: Bob Adair <bob.github@att.net>
@bobadair bobadair changed the title Add support for bridged RadioRA (classic) systems [lutron] Add support for bridged RadioRA (classic) systems Mar 7, 2021
@bobadair bobadair added the enhancement An enhancement or new feature for an existing add-on label Mar 7, 2021
@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/lutron-radiora-classic/111644/27

@@ -59,7 +63,8 @@ public void open(String portName, int baud) throws RadioRAConnectionException {
}

try {
serialPort = portIdentifier.open("openhab", 5000);
SerialPort serialPort = portIdentifier.open("openhab", 5000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not really necessary to create a local variable here

Copy link
Member Author

@bobadair bobadair Mar 11, 2021

Choose a reason for hiding this comment

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

Yes. I agree with you, but wherever you see this pattern it was done to eliminate compiler warnings associated with the Eclipse JDT null annotations. It seems to "helpfully" assume that if something is annotated as being Nullable but isn't a local variable, another thread may have come along and changed it to null behind your back. No matter if code design or use of locking prevents this. So the solution is to use a lot of otherwise unnecessary local variables. It would be interesting to see what the overall impact on GC is, although they are mostly just extra pointers.

@@ -52,6 +58,10 @@ public String getCommand() {
args.add(String.valueOf(fadeSec));
}

if (system == 1 || system == 2) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This block of code could maybe be pushed to RadioRACommand and reused throughout

@jjlauterbach
Copy link
Contributor

I've tested this change in a non bridge mode and haven't found any functional issues.

@bobadair
Copy link
Member Author

Thanks for the testing and comments, @jjlauterbach.

Signed-off-by: Bob Adair <bob.github@att.net>
@bobadair bobadair requested a review from a team March 16, 2021 23:32
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

Thanks!

@kaikreuzer kaikreuzer merged commit 4b70da4 into openhab:main Mar 31, 2021
@kaikreuzer kaikreuzer added this to the 3.1 milestone Mar 31, 2021
@bobadair bobadair deleted the raclassic branch April 1, 2021 01:53
Daniel-42 pushed a commit to Daniel-42/openhab-addons that referenced this pull request Apr 6, 2021
themillhousegroup pushed a commit to themillhousegroup/openhab2-addons that referenced this pull request May 10, 2021
…0302)

Signed-off-by: Bob Adair <bob.github@att.net>
Signed-off-by: John Marshall <john.marshall.au@gmail.com>
computergeek1507 pushed a commit to computergeek1507/openhab-addons that referenced this pull request Jul 13, 2021
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this pull request Nov 7, 2021
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
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.

4 participants