-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[alarmdecoder] Initial contribution #7189
Conversation
Signed-off-by: Bob Adair <bob.github@att.net> Also-by: Bill Forsyth (github: billfor)
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>
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>
Make sure to remove '[WIP]' from the title if you want reviewers to review. |
Signed-off-by: Bob Adair <bob.github@att.net>
Removed WIP from the title. We're still looking for more testers, but I think this is far enough along to get the review process started. |
Signed-off-by: Bob Adair <bob.github@att.net>
Signed-off-by: Bob Adair <bob.github@att.net>
Ok. I think that completes the list of high-priority changes, and eliminates all of the "TODO" comments in the code. Unless the testers find bugs that need to be fixed, I will now stop pushing commits until the initial review has been done. One dumb question: Since I've now re-written the serial bridge handler to use the OHC serial transport rather than using gnu.io directly, can I remove the |
...mdecoder/src/main/java/org/openhab/binding/alarmdecoder/internal/handler/ADThingHandler.java
Outdated
Show resolved
Hide resolved
...mdecoder/src/main/java/org/openhab/binding/alarmdecoder/internal/handler/ADThingHandler.java
Outdated
Show resolved
Hide resolved
...decoder/src/main/java/org/openhab/binding/alarmdecoder/internal/handler/IPBridgeHandler.java
Outdated
Show resolved
Hide resolved
...decoder/src/main/java/org/openhab/binding/alarmdecoder/internal/handler/IPBridgeHandler.java
Outdated
Show resolved
Hide resolved
...mdecoder/src/main/java/org/openhab/binding/alarmdecoder/internal/protocol/KeypadMessage.java
Outdated
Show resolved
Hide resolved
...larmdecoder/src/main/java/org/openhab/binding/alarmdecoder/internal/protocol/LRRMessage.java
Outdated
Show resolved
Hide resolved
...larmdecoder/src/main/java/org/openhab/binding/alarmdecoder/internal/protocol/RFXMessage.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.alarmdecoder/src/main/resources/ESH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.alarmdecoder/src/main/resources/ESH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
Signed-off-by: Bob Adair <bob.github@att.net>
Thanks for your comments @cpmeister, and for your very speedy initial review! |
Nope, you need to keep that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a general question regarding the discovery. If I understand it right there is some sort of message (RFX) received by the bridge (Where does this message come from? Is it triggered by something or sent by the device at some interval?) Which is then passed to the discovery service. It is not possible to trigger a scan for devices and the discovery service uses only the content of the message and the brigde-UID to create the discovered things, right?
Then why do you need a seprerate service for each bridge? You could create one service, inject that into the handler factory and pass it to the bridge handlers on creation. Then - when the proper message is received you pass that message and the bridge-uid to the service. You could then remove the whole register/unregister logic from the handler factory and simplify the discovery service.
@@ -0,0 +1,264 @@ | |||
# Alarm Decoder Binding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But why is this needed at all?
Yes, exactly. There is, unfortunately, no way to query the AD device for zone information, so when REL or EXP messages (for zone things) or RFX messages (for rfzone things) are received by the bridge handler, it passes them along to the discovery code. These all indicate state transitions for different types of zones. So, for example, when you first open a door or trigger a motion detector it would be discovered. It keeps hash sets of zones it has seen so it only "discovers" them once (per run, anyway). It is all just passive listening. There also does not appear to be any good way to discover the AD device itself.
You're right. It could be done using a single discovery service, and that would simplify the handler factory. The downside would be that it would complicate the discovery code - not so much because it would have to deal with zone sets for multiple bridge UIDs as because it would have to deal with concurrency. Right now it doesn't, as it can only be called by the bridge's single reader thread. Since I think it will be rare for users to run more than one bridge at a time, it may be best to let sleeping dogs lie for now. WDYT? |
Signed-off-by: Bob Adair <bob.github@att.net>
Travis tests were successfulHey @bobadair, |
Sorry, I've been doing some work on the Lutron binding, and switching my dev environment back and forth to modify and test this one has been slowing me down. Not to mention driving me nuts. Or more nuts than I already was? Anyway, I think the commit I just pushed should address a lot of the remaining comments. |
Signed-off-by: Bob Adair <bob.github@att.net>
Travis tests were successfulHey @bobadair, |
Ok @J-N-K. I think I've finally addressed all of the comments that I didn't have questions about. Can you take a look? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one last comment.
Please rebase on 2.5.x and run mvn spotless:apply
. We don't want to introduce new codestyle errors.
@@ -7,6 +7,7 @@ | |||
# Add-on maintainers: | |||
/bundles/org.openhab.binding.airquality/ @kubawolanin | |||
/bundles/org.openhab.binding.airvisualnode/ @3cky | |||
/bundles/org.openhab.binding.alarmdecoder/ @bobadair @billfor @berndpfrommer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did @berndpfrommer recently work on this binding? Since the CODEOWNERS is used to request reviewers, we should stick to those people that recenetly did major work on that code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
He is the author of the V1 binding, which this is derived from. I know he said he was short of time to work on an OH2 version, so I'm not sure if he even wants to see review notifications regarding it. @berndpfrommer, do you want to be on this list?
I did a spotless:apply and committed the changes on April 22. Does it need to be run again? |
Signed-off-by: Bob Adair <bob.github@att.net>
Travis tests were successfulHey @bobadair, |
We did only change some XML formatters for comments. I guess that is not a problem in this PR. I wanted to approve and merge and therefore looked at the report from Jenkins:
You can ignore the pom-error, |
Thanks @J-N-K. I thought that code analyzer warning was invalid. It is on an exception class defined within ADBridgeHandler. When I annotate it with @NonNullByDefault I get the compiler warning "Nullness default is redundant with a default specified for the enclosing type ADBridgeHandler". What is the right way to get rid it? I thought I had read that SCA would no longer generate these warnings for inner classes. |
Mhm. Probably that is fixed in SAT 0.10.0 which is only available for the OH3 branch. |
Thanks to everyone who tested this, commented on it, and reviewed the code! |
* [alarmdecoder] Initial commit of OH2 version Signed-off-by: Bob Adair <bob.github@att.net>
* [alarmdecoder] Initial commit of OH2 version Signed-off-by: Bob Adair <bob.github@att.net>
* [alarmdecoder] Initial commit of OH2 version Signed-off-by: Bob Adair <bob.github@att.net> Signed-off-by: CSchlipp <christian@schlipp.de>
* [alarmdecoder] Initial commit of OH2 version Signed-off-by: Bob Adair <bob.github@att.net>
* [alarmdecoder] Initial commit of OH2 version Signed-off-by: Bob Adair <bob.github@att.net>
* [alarmdecoder] Initial commit of OH2 version Signed-off-by: Bob Adair <bob.github@att.net>
* [alarmdecoder] Initial commit of OH2 version Signed-off-by: Bob Adair <bob.github@att.net>
* [alarmdecoder] Initial commit of OH2 version Signed-off-by: Bob Adair <bob.github@att.net> Signed-off-by: Daan Meijer <daan@studioseptember.nl>
* [alarmdecoder] Initial commit of OH2 version Signed-off-by: Bob Adair <bob.github@att.net>
This PR is for a new OH2 version of the OH1 alarmdecoder binding. It has been developed jointly with @billfor.
The original OH1 version of this binding was contributed by @berndpfrommer. A significant amount of code has been retained from the original binding, although it may not be immediately obvious due to the extensive changes and restructuring required to fit the OH2 binding model and to meet current code requirements.
The binding is fully functional, but has been through only limited testing.
Closes #7081