Skip to content

Commit

Permalink
Initial verion of panasonictv oh2 binding
Browse files Browse the repository at this point in the history
Signed-off-by: Prakashbabu Sidaraddi <e.prakashs@gmail.com> (github:
scienty)
  • Loading branch information
prakash authored and scienty committed Dec 18, 2018
1 parent 2a531e7 commit c334b2c
Show file tree
Hide file tree
Showing 33 changed files with 2,076 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addons/binding/org.openhab.binding.panasonictv/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
33 changes: 33 additions & 0 deletions addons/binding/org.openhab.binding.panasonictv/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.openhab.binding.panasonictv</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<binding:binding id="panasonictv"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd">

<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>

</binding:binding>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<config-description:config-descriptions
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:config-description="http://eclipse.org/smarthome/schemas/config-description/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0 http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd">

<config-description uri="thing-type:panasonictv:tv">
<parameter name="hostName" type="text" required="true">
<label>Host name</label>
<description>Network address of the Panasonic TV.</description>
<context>network-address</context>
</parameter>
<parameter name="port" type="integer" min="1" max="65335">
<label>TCP Port</label>
<description>TCP port of the Panasonic TV.</description>
<default>55000</default>
</parameter>
<parameter name="refreshInterval" type="integer" unit="ms">
<label>Refresh Interval</label>
<description>States how often a refresh shall occur in milliseconds.
</description>
<default>1000</default>
</parameter>
</config-description>

</config-description:config-descriptions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# binding
binding.panasonictv.name = Panasonic TV Binding
binding.panasonictv.description = Dieses Binding integriert Panasonic TV Geräte, wodurch diese gesteuert werden können.

# thing types
thing-type.panasonictv.tv.label = Panasonic TV
thing-type.panasonictv.tv.description = Dient zur Steuerung des Gerätes und liefert Daten wie z.B. Infos über den aktuellen Kanal oder die laufende Sendung.

# thing types config
thing-type.config.panasonictv.tv.hostName.label = IP-Adresse
thing-type.config.panasonictv.tv.hostName.description = Lokale IP-Adresse oder Hostname des Panasonic TV.
thing-type.config.panasonictv.tv.port.label = Port
thing-type.config.panasonictv.tv.port.description = Port des Panasonic TV.
thing-type.config.panasonictv.tv.refreshInterval.label = Abfrageintervall
thing-type.config.panasonictv.tv.refreshInterval.description = Intervall zur Abfrage des Panasonic TV (in Millisekunden).

# channel types
channel-type.panasonictv.volume.label = Lautstärke
channel-type.panasonictv.volume.description = Ermöglicht die Steuerung der Lautstärke.
channel-type.panasonictv.mute.label = Stumm schalten
channel-type.panasonictv.mute.description = Ermöglicht die Lautstärke auf stumm zu schalten.
channel-type.panasonictv.sourcename.label = Source
channel-type.panasonictv.sourcename.description = Zeigt die Quelle des eingehenden Signals an.
channel-type.panasonictv.sourceid.label = Source ID
channel-type.panasonictv.sourceid.description = Zeigt die ID der Quelle des eingehenden Signals an.
channel-type.panasonictv.keycode.label = Tastendruck
channel-type.panasonictv.keycode.description = Ermöglicht das Senden eines Eingabebefehls an das Gerät.
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="panasonictv"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">

<channel-type id="volume">
<item-type>Dimmer</item-type>
<label>Volume</label>
<description>Volume level of the TV.</description>
<category>SoundVolume</category>
</channel-type>

<channel-type id="mute">
<item-type>Switch</item-type>
<label>Mute</label>
<description>Mute state of the TV.</description>
</channel-type>

<channel-type id="sourcename">
<item-type>String</item-type>
<label>Source Name</label>
<description>Name of the current source.</description>
<state readOnly="true" />
</channel-type>

<channel-type id="sourceid" advanced="true">
<item-type>String</item-type>
<label>Source ID</label>
<description>Id of the current source.</description>
<state readOnly="true" />
</channel-type>

<channel-type id="keycode">
<item-type>String</item-type>
<label>Key Code</label>
<description>The key code channel emulates the infrared remote controller and
allows to send virtual button presses.
</description>
<state>
<options>
<option value="NRC_CH_DOWN-ONOFF">CH_DOWN</option>
<option value="NRC_30S_SKIP-ONOFF">30S_SKIP</option>
<option value="NRC_3D-ONOFF">3D</option>
<option value="NRC_BD-ONOFF">DB</option>
<option value="NRC_BLUE-ONOFF">BLUE</option>
<option value="NRC_CANCEL-ONOFF">CANCEL</option>
<option value="NRC_CC-ONOFF">CC</option>
<option value="NRC_CH_UP-ONOFF">CH_UP</option>
<option value="NRC_CHG_INPUT-ONOFF">CHG_INPUT</option>
<option value="NRC_CHG_NETWORK-ONOFF">CHG_NETWORK</option>
<option value="NRC_D0-ONOFF">D0</option>
<option value="NRC_D1-ONOFF">D1</option>
<option value="NRC_D2-ONOFF">D2</option>
<option value="NRC_D3-ONOFF">D3</option>
<option value="NRC_D4-ONOFF">D4</option>
<option value="NRC_D5-ONOFF">D5</option>
<option value="NRC_D6-ONOFF">D6</option>
<option value="NRC_D7-ONOFF">D7</option>
<option value="NRC_D8-ONOFF">D8</option>
<option value="NRC_D9-ONOFF">D9</option>
<option value="NRC_DATA-ONOFF">DATA</option>
<option value="NRC_DIGA_CTL-ONOFF">DIGA_CTL</option>
<option value="NRC_DISP_MODE-ONOFF">DSIP_MODE</option>
<option value="NRC_DMS_CH_DOWN-ONOFF">DMS_CH_DOWN</option>
<option value="NRC_DMS_CH_UP-ONOFF">DMS_CH_UP</option>
<option value="NRC_DOWN-ONOFF">DOWN</option>
<option value="NRC_DRIVE-ONOFF">DRIVE</option>
<option value="NRC_ECO-ONOFF">ECO</option>
<option value="NRC_ENTER-ONOFF">ENTER</option>
<option value="NRC_EPG-ONOFF">EPG</option>
<option value="NRC_EZ_SYNC-ONOFF">EZ_SYNC</option>
<option value="NRC_FAVORITE-ONOFF">FAVORITE</option>
<option value="NRC_FF-ONOFF">FF</option>
<option value="NRC_GAME-ONOFF">GAME</option>
<option value="NRC_GREEN-ONOFF">GREEN</option>
<option value="NRC_HDMI1-ONOFF">HDMI1</option>
<option value="NRC_HDMI2-ONOFF">HDMI2</option>
<option value="NRC_HDMI3-ONOFF">HDMI3</option>
<option value="NRC_HDMI4-ONOFF">HDMI4</option>
<option value="NRC_HOLD-ONOFF">HOLD</option>
<option value="NRC_INDEX-ONOFF">INDEX</option>
<option value="NRC_INFO-ONOFF">INFO</option>
<option value="NRC_INTERNET-ONOFF">INTERNET</option>
<option value="NRC_LEFT-ONOFF">LEFT</option>
<option value="NRC_MENU-ONOFF">MENU</option>
<option value="NRC_MPX-ONOFF">MPX</option>
<option value="NRC_MUTE-ONOFF">MUTE</option>
<option value="NRC_OFFTIMER-ONOFF">OFFTIMER</option>
<option value="NRC_P_NR-ONOFF">P_NR</option>
<option value="NRC_PAUSE-ONOFF">PAUSE</option>
<option value="NRC_PICTAI-ONOFF">PICTAI</option>
<option value="NRC_PLAY-ONOFF">PLAY</option>
<option value="NRC_POWER-ONOFF">POWER</option>
<option value="NRC_PROG-ONOFF">PROG</option>
<option value="NRC_R_TUNE-ONOFF">R_TUNE</option>
<option value="NRC_RECLIST-ONOFF">RECLIST</option>
<option value="NRC_REC-ONOFF">REC</option>
<option value="NRC_RED-ONOFF">RED</option>
<option value="NRC_RETURN-ONOFF">RETURN</option>
<option value="NRC_REW-ONOFF">REW</option>
<option value="NRC_RIGHT-ONOFF">RIGHT</option>
<option value="NRC_SAP-ONOFF">SAP</option>
<option value="NRC_SD_CARD-ONOFF">SD_CARD</option>
<option value="NRC_SKIP_NEXT-ONOFF">SKIP_NEXT</option>
<option value="NRC_SKIP_PREV-ONOFF">SKIP_PREV</option>
<option value="NRC_SPLIT-ONOFF">SPLIT</option>
<option value="NRC_STOP-ONOFF">STOP</option>
<option value="NRC_STTL-ONOFF">STTL</option>
<option value="NRC_SUBMENU-ONOFF">SUBMENU</option>
<option value="NRC_SWAP-ONOFF">SWAP</option>
<option value="NRC_TEXT-ONOFF">TEXT</option>
<option value="NRC_TV_MUTE_OFF-ONOFF">TV_MUTE_OFF</option>
<option value="NRC_TV_MUTE_ON-ONOFF">TV_MUTE_ON</option>
<option value="NRC_TV-ONOFF">TV</option>
<option value="NRC_UP-ONOFF">UP</option>
<option value="NRC_VIDEO1-ONOFF">VIDEO1</option>
<option value="NRC_VIDEO2-ONOFF">VIDEO2</option>
<option value="NRC_VIERA_LINK-ONOFF">VIERA_LINK</option>
<option value="NRC_VOD-ONOFF">VOD</option>
<option value="NRC_VOLDOWN-ONOFF">VOLDOWN</option>
<option value="NRC_VOLUP-ONOFF">VOLUP</option>
<option value="NRC_VTOOLS-ONOFF">VTOOLS</option>
<option value="NRC_YELLOW-ONOFF">YELLOW</option>
</options>
</state>
</channel-type>

</thing:thing-descriptions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="panasonictv"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">

<thing-type id="tv">
<label>Panasonic TV</label>
<description>Allows to control Panasonic TV</description>

<channels>
<channel id="volume" typeId="volume" />
<channel id="mute" typeId="mute" />
<channel id="keyCode" typeId="keycode" />

<channel id="sourceName" typeId="sourcename" />
<channel id="sourceId" typeId="sourceid" />
</channels>

<config-description-ref uri="thing-type:panasonictv:tv" />
</thing-type>

</thing:thing-descriptions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.openhab.binding.panasonictv
Bundle-ClassPath: .
Bundle-ManifestVersion: 2
Bundle-Name: Panasonic Tv Binding
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-SymbolicName: org.openhab.binding.panasonictv;singleton:=true
Bundle-Vendor: openHAB
Bundle-Version: 2.5.0.qualifier
Export-Package:
org.openhab.binding.panasonictv,
org.openhab.binding.panasonictv.handler
Import-Package:
com.google.common.collect,
org.apache.commons.net.util,
org.eclipse.jdt.annotation;resolution:=optional,
org.eclipse.smarthome.config.core,
org.eclipse.smarthome.config.discovery,
org.eclipse.smarthome.core.library.types,
org.eclipse.smarthome.core.thing,
org.eclipse.smarthome.core.thing.binding,
org.eclipse.smarthome.core.types,
org.eclipse.smarthome.config.discovery.upnp,
org.eclipse.smarthome.io.transport.upnp,
org.jupnp,
org.jupnp.binding.xml,
org.jupnp.controlpoint,
org.jupnp.model,
org.jupnp.model.action,
org.jupnp.model.meta,
org.jupnp.model.types,
org.jupnp.registry,
org.openhab.binding.panasonictv,
org.openhab.binding.panasonictv.handler,
org.slf4j
Service-Component: OSGI-INF/*.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010-2018 by the respective copyright holders.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
-->
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.openhab.binding.panasonictv.discovery">
<implementation class="org.openhab.binding.panasonictv.internal.discovery.PanasonicTvDiscoveryParticipant"/>
<service>
<provide interface="org.eclipse.smarthome.config.discovery.upnp.UpnpDiscoveryParticipant"/>
</service>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010-2018 by the respective copyright holders.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
-->
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.openhab.binding.panasonictv.internal.PanasonicTvHandlerFactory">

<implementation class="org.openhab.binding.panasonictv.internal.PanasonicTvHandlerFactory"/>
<reference bind="setUpnpIOService" cardinality="1..1" interface="org.eclipse.smarthome.io.transport.upnp.UpnpIOService" name="UpnpIOService" policy="static" unbind="unsetUpnpIOService"/>
<reference bind="setDiscoveryServiceRegistry" cardinality="1..1" interface="org.eclipse.smarthome.config.discovery.DiscoveryServiceRegistry" name="DiscoveryServiceRegistry" policy="static" unbind="unsetDiscoveryServiceRegistry"/>
<reference bind="setUpnpService" cardinality="1..1" interface="org.jupnp.UpnpService" name="UpnpService" policy="static" unbind="unsetUpnpService"/>

<service>
<provide interface="org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory"/>
</service>

</scr:component>
Loading

0 comments on commit c334b2c

Please sign in to comment.