-
-
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
[sony] New binding #6884
[sony] New binding #6884
Conversation
Travis tests were successfulHey @tmrobert8, |
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.
LGTM
Travis tests were successfulHey @tmrobert8, |
...ny/src/main/java/org/openhab/binding/sony/internal/providers/SonyDefinitionProviderImpl.java
Outdated
Show resolved
Hide resolved
...ny/src/main/java/org/openhab/binding/sony/internal/providers/SonyDefinitionProviderImpl.java
Outdated
Show resolved
Hide resolved
Travis tests were successfulHey @tmrobert8, |
Travis tests were successfulHey @tmrobert8, |
2 similar comments
Travis tests were successfulHey @tmrobert8, |
Travis tests were successfulHey @tmrobert8, |
Hi, I have STR DN1030 sound receiver |
I guess those questions belong here: https://community.openhab.org/t/sony-devices-binding/14052 Edit: All review comments are done right? 4 years of development wauw! |
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.
Ok. I think I've reviewed this 😭 This is a horribly large pull request. Please don't that again 😜
In general my comments can be summarized as follows:
- The Apache commons library will be removed in openHAB 3. Therefor it should not be used. Please replace all usages of this library (I guess the fastest is to add some util in you binding to implement the most used you have).
- We don't have the
immediate = true
on Components. Please remove them (I commented on them, but I'm not sure if I got them all) - For java libraries we require to add a copyright notice about the library in the NOTICE file. I would suggest you need to do this for the JavaScript libraries you have included too (See some other NOTICE file on how to do it, it's 4 lines per item)
- You have included a number of fonts. These add 2.3 MB to the size of the distribution. We try to minimize size as much as possible because with a lot of bindings it otherwise becomes a huge package. So my suggestion is to remove those fonts and rely on the standard provided fonts.
- There are several other readme pages here. Recently I saw a comment about a missing page on our documentation page, which was also another additional page to a binding. So it looks like only the readme itself is published on the documentation page. Therefor it might be those other pages will not be available. This is something that might need to be looked into.
<parent> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.addons.reactor.bundles</artifactId> | ||
<version>2.5.5-SNAPSHOT</version> |
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.
<version>2.5.5-SNAPSHOT</version> | |
<version>2.5.9-SNAPSHOT</version> |
import org.apache.commons.lang.StringUtils; | ||
import org.apache.commons.lang.Validate; |
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.
You need to remove all usages of the apache commons library as that library will be removed from openHAB 3.0.
public static final Integer RSP_WAIT_TIMEOUTSECONDS = 10; | ||
|
||
/** The user agent for communications (and identification on the device) */ | ||
public static final String NET_USERAGENT = "OpenHab/Sony/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.
public static final String NET_USERAGENT = "OpenHab/Sony/Binding"; | |
public static final String NET_USERAGENT = "openHAB/Sony/Binding"; |
* @author Tim Roberts - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
@Component(immediate = true, service = ThingHandlerFactory.class, configurationPid = "sony.things") |
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.
@Component(immediate = true, service = ThingHandlerFactory.class, configurationPid = "sony.things") | |
@Component(service = ThingHandlerFactory.class, configurationPid = "binding.sony") |
return new ArrayList<>(); | ||
} | ||
|
||
return list.stream().filter(e -> e != null).collect(Collectors.toList()); |
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.
return list.stream().filter(e -> e != null).collect(Collectors.toList()); | |
return list.stream().filter(Objects::nonNull).collect(Collectors.toList()); |
<default>eth0</default> | ||
<advanced>true</advanced> | ||
</parameter> | ||
<parameter name="refresh" type="integer"> |
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.
<parameter name="refresh" type="integer"> | |
<parameter name="refresh" type="integer" unit="s"> |
Same comment for other parameters with time.
* | ||
* <pre> | ||
* {@code | ||
need example |
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.
Remove empty example.
System.arraycopy(macBytes, 0, bytes, i, macBytes.length); | ||
} | ||
|
||
// logger.debug("Sending WOL to " + ipAddress + " (" + macAddress + ")"); |
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.
Remove commented out code.
final Map<String, String> lowerMap1 = map1.entrySet().stream() | ||
.map(s -> new AbstractMap.SimpleEntry<>(StringUtils.lowerCase(s.getKey()), | ||
StringUtils.lowerCase(s.getValue()))) | ||
.collect(Collectors.toMap(k -> k.getKey(), v -> v.getValue())); |
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.
Doesn't toLowerCase
not work (without using the additonal .map
)?
.collect(Collectors.toMap(k -> k.getKey(), v -> v.getValue())); | |
.collect(Collectors.toMap(k -> k.getKey().toLowerCase(), v -> v.getValue().toLowerCase())); |
|
||
@Override | ||
public boolean removeListener(final SonyModelListener listener) { | ||
return sources.stream().map(s -> s.removeListener(listener)).anyMatch(e -> e); |
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.
return sources.stream().map(s -> s.removeListener(listener)).anyMatch(e -> e); | |
return sources.stream().map(s -> s.removeListener(listener)).anyMatch(Function.identity()); |
Automatic code migration to openHAB 3 succeeded. The resulting code can be found at https://ci.openhab.org/job/openHAB-Addons-Migration/53/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. |
Automatic code migration to openHAB 3 succeeded. The resulting code can be found at https://ci.openhab.org/job/openHAB-Addons-Migration/115/artifact/bundles/. You can download the migrated code from there and create a new PR against the main 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. |
Closing this PR as it is not in a mergeable state. Please follow the instructions to port this PR to the main branch for openHAB 3. |
After 4 years of development - finally asking for a merge on the sony addon. This is the most complete sony implementation to date and will be one of the largest bindings to review (be prepared).
A few notes:
Good luck and let me know what you'll need from me!