-
Notifications
You must be signed in to change notification settings - Fork 784
Conversation
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.
Thanks very much for this really good contribution!
I just had a look through and left a few comments - don't panic by the sheer number, it's mostly about blank lines where they don't add to the readability and a few minor remarks where you might want to have a look.
There is only one major question I have. It's about the channel, whether it should be only one for sending AND receiving, or maybe we should split this in two as we are talking about different physical things: one is a button on the remote control which was pressed, the other is a state of a device which should be altered. See also my inline comment about it.
@@ -0,0 +1,11 @@ | |||
# binding | |||
binding.lirc.name = <Your localized Binding name> |
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.
???
<!-- LIRC Server --> | ||
<bridge-type id="bridge"> | ||
<label>LIRC Server</label> | ||
<description>The LIRC Server represents the LIRC Server bridge.</description> |
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.
x representing x doesn't say much. How about "The LIRC Server Bridge"?
</parameter> | ||
<parameter name="portNumber" type="integer" min="0" max="65536" step="1"> | ||
<label>Port Number</label> | ||
<description>The port number the LIRC server is listening on.</description> |
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.
The port the LIRC server is listening to
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" | ||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> | ||
|
||
<!-- Sample Thing Type --> |
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.
"Sample", really??
|
||
</thing-type> | ||
|
||
<!-- Sample Channel Type --> |
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.
Sample, really?
} | ||
|
||
private void addRemote(ThingUID bridge, String remote) { | ||
|
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.
blank line
*/ | ||
package org.eclipse.smarthome.binding.lirc.internal.messages; | ||
|
||
public class LIRCButtonEvent { |
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.
here some javadoc is missing
package org.eclipse.smarthome.binding.lirc.internal.messages; | ||
|
||
public class LIRCButtonEvent { | ||
String 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.
these fields should all be private final
} | ||
|
||
public String getCode() { | ||
|
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.
blank line
*/ | ||
package org.eclipse.smarthome.binding.lirc.internal.messages; | ||
|
||
public class LIRCResponse { |
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.
javadoc is missing
The binding does not send the number of repeats and does not support UNIX sockets, so the LIRC server must be exposed as over TCP. Signed-off-by: Andrew Nagle <kabili@zyrenth.com>
Okay, I've gone through and updated everything based on your suggestions. Splitting the channel into "event" and "transmit" channels worked nicely and does make a lot more sense. |
The way LIRC handles transmitting repeats isn't how most users expect it to behave. Sending the command "KEY_VOLUMEUP 5" would actually transmit the volume up code six times. The commit changes that behavior to be more user-friendly. This also includes examples on using the binding. Signed-off-by: Andrew Nagle <kabili@zyrenth.com>
+1 User wants to use this and gets to test binding with openhab2 on RPi3 |
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
Thanks a lot for addressing all the comments that quickly and my deepest apologies for then taking ages to getting back to this! From my point of view this now is good to go. As your PR exceeds 1000 lines of code, we unfortunately have to run it through Eclipse's IP process. This will hopefully only add a few days or additional delay and normally won't impose any work on your side. The only think I need to ask you is to not push any further commits to here. In case it should be necessary it will have to go through another PR. |
For the record: I have submitted this as CQ 13830 |
Good news: the CQ has been approved. |
Thanks! |
|
||
<config-description> | ||
<parameter name="host" type="text"> | ||
<label>The Host</label> |
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.
Please add context "network-address".
<parameter name="host" type="text"> | ||
<label>The Host</label> | ||
<description>The host of the LIRC server</description> | ||
<required>true</required> |
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.
If there is a default, you usually should not set required to true.
<default>localhost</default> | ||
</parameter> | ||
<parameter name="portNumber" type="integer" min="0" max="65536" step="1"> | ||
<label>Port Number</label> |
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.
"Port" should be good enough.
<parameter name="portNumber" type="integer" min="0" max="65536" step="1"> | ||
<label>Port Number</label> | ||
<description>The port number the LIRC server is listening to.</description> | ||
<required>true</required> |
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.
If there is a default, you usually should not set required to true.
Bundle-SymbolicName: org.eclipse.smarthome.binding.lirc;singleton:=true | ||
Bundle-Vendor: Eclipse.org/SmartHome | ||
Bundle-Version: 0.9.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 |
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.
Should be 1.8
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
|
||
Copyright (c) 2014-2016 by the respective copyright holders. |
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.
looks like an outdated header (should be 2017)
[Install] | ||
WantedBy=multi-user.target | ||
``` | ||
By default, LIRC will listen on IP address 0.0.0.0 (any available IP address) and port 8765. If you would |
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.
please add an empty line after every code section.
Thing remote Samsung [ remote="Samsung" ] | ||
} | ||
``` | ||
Bridge: |
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.
please add an empty line after every code section.
* **remote**: The name of the remote as known by LIRC | ||
|
||
### Items | ||
```xtend |
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.
please add an empty line after every header.
``` | ||
|
||
### Rules | ||
```xtend |
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.
please add an empty line after every code header.
see #3848 |
Thank you for taking care of that @SJKA! |
This binding allows decoding and sending of infrared signals used by most remotes controls via LIRC (and its Windows counterpart WinLIRC).
Each remote that is known by LIRC is represented by a thing with a single channel. This channel is a String type that contains the name of the button the user pressed.
I had considered dynamically creating channels for each button on a remote, but I decided against it as most TV remotes can have upwards of of 30 or more buttons and only one can be activated at any given time.
Signed-off-by: Andrew Nagle kabili@zyrenth.com