-
-
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
[panasonictv] Initial Contribution #11558
Conversation
Signed-off-by: Prakashbabu Sidaraddi <[email protected]> (github: scienty) # Conflicts: # addons/binding/pom.xml # bundles/org.openhab.binding.panasonictv/.classpath # bundles/org.openhab.binding.panasonictv/.project # bundles/org.openhab.binding.panasonictv/.settings/org.eclipse.core.resources.prefs # bundles/org.openhab.binding.panasonictv/.settings/org.eclipse.jdt.core.prefs # bundles/org.openhab.binding.panasonictv/.settings/org.eclipse.m2e.core.prefs # bundles/org.openhab.binding.panasonictv/ESH-INF/binding/binding.xml # bundles/org.openhab.binding.panasonictv/ESH-INF/config/config.xml # bundles/org.openhab.binding.panasonictv/ESH-INF/i18n/panasonic_de.properties # bundles/org.openhab.binding.panasonictv/ESH-INF/thing/channel-types.xml # bundles/org.openhab.binding.panasonictv/ESH-INF/thing/thing-types.xml # bundles/org.openhab.binding.panasonictv/META-INF/MANIFEST.MF # bundles/org.openhab.binding.panasonictv/OSGI-INF/PanasonicTvDiscovery.xml # bundles/org.openhab.binding.panasonictv/OSGI-INF/PanasonicTvHandlerFactory.xml # bundles/org.openhab.binding.panasonictv/README.md # bundles/org.openhab.binding.panasonictv/about.html # bundles/org.openhab.binding.panasonictv/build.properties # bundles/org.openhab.binding.panasonictv/pom.xml # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/PanasonicTvBindingConstants.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/handler/PanasonicTvHandler.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/PanasonicTvHandlerFactory.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/config/PanasonicTvConfiguration.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/discovery/PanasonicTvDiscoveryParticipant.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/protocol/RemoteControllerException.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/protocol/UpnpRemoteController.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/service/DataConverters.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/service/MediaRendererService.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/service/PanasonicTvUtils.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/service/RemoteControllerService.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/service/ServiceFactory.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/service/api/EventListener.java # bundles/org.openhab.binding.panasonictv/src/main/java/org/openhab/binding/panasonictv/internal/service/api/PanasonicTvService.java # features/openhab-addons/src/main/feature/feature.xml
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
fix readme and properties to changed thing configuration Signed-off-by: Michael Binder <[email protected]>
Signed-off-by: Michael Binder <[email protected]>
optimize imports Signed-off-by: Michael Binder <[email protected]>
b3cef7e
to
0c3a672
Compare
As far as I can see you don't have the power state/command in there? Is there a specific reason for that? |
You need to send "Power" (or exactly "NRC_POWER-ONOFF") to the keycode channel. I didn't find a way to identify if the device is powered on. My tv can be in standby or powered on mode. In standby it can also be reachable by network or not, depending on it's network settings. If it is reachable the thing is considered online, but I can not determine if is powered on. |
I've described how that's done in #4407. Additionally you should only send the power key code then if the command state is != the current state, otherwise sending on would turn the TV off if it's already on. |
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 for your contribution! I reviewed your code and here is my feedback.
There is one checkstyle warning left. You could take a look at target/code-analysis/report.html
after building it with mvn clean install
.
@@ -228,6 +228,7 @@ | |||
/bundles/org.openhab.binding.oppo/ @mlobstein | |||
/bundles/org.openhab.binding.orbitbhyve/ @octa22 | |||
/bundles/org.openhab.binding.orvibo/ @tavalin | |||
/bundles/org.openhab.binding.panasonictv/ @J-N-K |
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.
This username shouldn't be the author, but the maintainer of the binding. If you want to maintain this binding in the future, this should be your username.
Panasonic TVs does not support full UPNP standard functionalities | ||
Volume and Mute status are updated in real time | ||
Most of the control is provided by sending Key Code to RemoteControl API | ||
|
||
Source Name (read only) is updated when a Key Code to change the source is sent to tv, otherwise it is Undefined |
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 finish the sentences with a period (.).
| Model | State | Notes | | ||
|---------------|---------|--------------------------------------------------------------------------------------| | ||
| Viera E6 | OK | Initial contribution is done by this model | | ||
| TX-40CX680 | OK | Initial contribution is done by this model | |
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 could mention the Thing Type UIDs. These are necessary for textual configuration.
## Binding Configuration | ||
|
||
The binding does not require any special configuration. |
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.
This can be removed, then.
The Panasonic TV Thing requires the UPNP UDN of the RemoteController and MediaRenderer as a configuration value in order for the binding to know how to access it. Panasonic TV publish several UPnP devices and the manufacturer and service names are used to recognize those UPnP devices. | ||
Additionally, a refresh interval can be configured in milliseconds to specify how often TV resources are polled. |
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 could add a table with the configuration parameters like in other binding readmes. See for example https://www.openhab.org/addons/bindings/telegram/#thing-configuration
|
||
updateResourceState(SERVICE_ID, "SetVolume", | ||
Map.of("InstanceID", "0", "Channel", "Master", "DesiredVolume", Integer.toString(newValue))); | ||
// updateResourceState(SERVICE_ID, "GetVolume", Map.of("InstanceID", "0", "Channel", "Master")); |
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.
Can this be removed? Same for below.
|
||
<name>Panasonic TV Binding</name> | ||
<description>This is the binding for Panasonic TV. Binding should support all Panasonic Viera TV models</description> | ||
<author>Prakashbabu Sidaraddi</author> |
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 author tag is deprecated and should therefore be removed. See openhab/openhab-core#1844.
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.
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.
<channel-type id="volume"> | ||
<item-type>Dimmer</item-type> | ||
<label>Volume</label> | ||
<description>Volume level of the TV.</description> | ||
<category>SoundVolume</category> | ||
</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.
There's a predefined system channel you could use. See https://www.openhab.org/docs/developer/bindings/thing-xml.html#system-state-channel-types
<channel-type id="mute"> | ||
<item-type>Switch</item-type> | ||
<label>Mute</label> | ||
<description>Mute state of the TV.</description> | ||
</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.
Same for mute.
@@ -0,0 +1,44 @@ | |||
/** | |||
* Copyright (c) 2010-2021 Contributors to the openHAB project |
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.
This needs to be updated to 2022. You can do it automatically by invoking mvn license:format
in the root dir of this repo.
Thanks you very much. I will check your feedback. This may take some time. |
@@ -0,0 +1,17 @@ | |||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
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.
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
See #11833
<parent> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.addons.reactor.bundles</artifactId> | ||
<version>3.2.0-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>3.2.0-SNAPSHOT</version> | |
<version>4.2.0-SNAPSHOT</version> |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/comparison-to-home-assistant/151931/57 |
Unfortunately it looks like we cannot bring this PR to the finish line. After two years of inactivity i close this PR. If there is a need to restart, feel free to re-open or start a new PR. |
I would like to contribute/continue the work done for adding the panasonictv binding from oh1 to oh3.
Therefore I used the existing migrations from #3904, #6179 and #9024.
There is also a discussion in https://community.openhab.org/t/panasonictv-oh3/108124
Issue for this PR #11559
DESCRIPTION
https://www.openhab.org/docs/developer/guidelines.html => Yes
https://www.openhab.org/docs/developer/bindings/#include-the-binding-in-the-build => Yes
https://www.openhab.org/docs/developer/contributing.html#sign-your-work => Yes