mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-26 15:21:41 +01:00
[androidtv] Adds gtvEnabled Option (#15317)
* Adds gtvEnabled --------- Signed-off-by: Ben Rosenblum <rosenblumb@gmail.com>
This commit is contained in:
parent
27d784a4b1
commit
3e1686b1f7
@ -37,6 +37,7 @@ There are three required fields to connect successfully to a ShieldTV.
|
|||||||
| ipAddress | text | IP address of the device | N/A | yes | no |
|
| ipAddress | text | IP address of the device | N/A | yes | no |
|
||||||
| keystore | text | Location of the Java Keystore | N/A | no | no |
|
| keystore | text | Location of the Java Keystore | N/A | no | no |
|
||||||
| keystorePassword | text | Password of the Java Keystore | N/A | no | no |
|
| keystorePassword | text | Password of the Java Keystore | N/A | no | no |
|
||||||
|
| gtvEnabled | boolean | Enable/Disable the GoogleTV protocol | true | no | no |
|
||||||
|
|
||||||
```java
|
```java
|
||||||
Thing androidtv:shieldtv:livingroom [ ipAddress="192.168.1.2" ]
|
Thing androidtv:shieldtv:livingroom [ ipAddress="192.168.1.2" ]
|
||||||
|
@ -50,6 +50,7 @@ public class AndroidTVBindingConstants {
|
|||||||
|
|
||||||
// List of all config properties
|
// List of all config properties
|
||||||
public static final String PROPERTY_IP_ADDRESS = "ipAddress";
|
public static final String PROPERTY_IP_ADDRESS = "ipAddress";
|
||||||
|
public static final String PROPERTY_GTV_ENABLED = "gtvEnabled";
|
||||||
|
|
||||||
// List of all static String literals
|
// List of all static String literals
|
||||||
public static final String PIN_REQUEST = "REQUEST";
|
public static final String PIN_REQUEST = "REQUEST";
|
||||||
|
@ -157,6 +157,7 @@ public class AndroidTVHandler extends BaseThingHandler {
|
|||||||
|
|
||||||
GoogleTVConfiguration googletvConfig = getConfigAs(GoogleTVConfiguration.class);
|
GoogleTVConfiguration googletvConfig = getConfigAs(GoogleTVConfiguration.class);
|
||||||
String ipAddress = googletvConfig.ipAddress;
|
String ipAddress = googletvConfig.ipAddress;
|
||||||
|
boolean gtvEnabled = googletvConfig.gtvEnabled;
|
||||||
|
|
||||||
if (ipAddress.isBlank()) {
|
if (ipAddress.isBlank()) {
|
||||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
|
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
|
||||||
@ -164,7 +165,9 @@ public class AndroidTVHandler extends BaseThingHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
googletvConnectionManager = new GoogleTVConnectionManager(this, googletvConfig);
|
if (THING_TYPE_GOOGLETV.equals(thingTypeUID) || gtvEnabled) {
|
||||||
|
googletvConnectionManager = new GoogleTVConnectionManager(this, googletvConfig);
|
||||||
|
}
|
||||||
|
|
||||||
if (THING_TYPE_SHIELDTV.equals(thingTypeUID)) {
|
if (THING_TYPE_SHIELDTV.equals(thingTypeUID)) {
|
||||||
ShieldTVConfiguration shieldtvConfig = getConfigAs(ShieldTVConfiguration.class);
|
ShieldTVConfiguration shieldtvConfig = getConfigAs(ShieldTVConfiguration.class);
|
||||||
@ -239,6 +242,9 @@ public class AndroidTVHandler extends BaseThingHandler {
|
|||||||
shieldtvConnectionManager.handleCommand(channelUID, command);
|
shieldtvConnectionManager.handleCommand(channelUID, command);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else if (googletvConnectionManager == null) {
|
||||||
|
shieldtvConnectionManager.handleCommand(channelUID, command);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,4 +32,5 @@ public class GoogleTVConfiguration {
|
|||||||
public boolean shim;
|
public boolean shim;
|
||||||
public boolean shimNewKeys;
|
public boolean shimNewKeys;
|
||||||
public String mode = "";
|
public String mode = "";
|
||||||
|
public boolean gtvEnabled;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@ thing-type.androidtv.shieldtv.description = Nvidia ShieldTV
|
|||||||
|
|
||||||
thing-type.config.androidtv.googletv.delay.label = Delay
|
thing-type.config.androidtv.googletv.delay.label = Delay
|
||||||
thing-type.config.androidtv.googletv.delay.description = Delay between messages
|
thing-type.config.androidtv.googletv.delay.description = Delay between messages
|
||||||
|
thing-type.config.androidtv.googletv.gtvEnabled.label = Enable GoogleTV
|
||||||
|
thing-type.config.androidtv.googletv.gtvEnabled.description = Enable the GoogleTV Protocol
|
||||||
thing-type.config.androidtv.googletv.heartbeat.label = Heartbeat Frequency
|
thing-type.config.androidtv.googletv.heartbeat.label = Heartbeat Frequency
|
||||||
thing-type.config.androidtv.googletv.heartbeat.description = Frequency of heartbeats
|
thing-type.config.androidtv.googletv.heartbeat.description = Frequency of heartbeats
|
||||||
thing-type.config.androidtv.googletv.ipAddress.label = Hostname
|
thing-type.config.androidtv.googletv.ipAddress.label = Hostname
|
||||||
@ -28,6 +30,8 @@ thing-type.config.androidtv.googletv.reconnect.label = Reconnect Delay
|
|||||||
thing-type.config.androidtv.googletv.reconnect.description = Delay between reconnection attempts
|
thing-type.config.androidtv.googletv.reconnect.description = Delay between reconnection attempts
|
||||||
thing-type.config.androidtv.shieldtv.delay.label = Delay
|
thing-type.config.androidtv.shieldtv.delay.label = Delay
|
||||||
thing-type.config.androidtv.shieldtv.delay.description = Delay between messages
|
thing-type.config.androidtv.shieldtv.delay.description = Delay between messages
|
||||||
|
thing-type.config.androidtv.shieldtv.gtvEnabled.label = Enable GoogleTV
|
||||||
|
thing-type.config.androidtv.shieldtv.gtvEnabled.description = Enable the GoogleTV Protocol
|
||||||
thing-type.config.androidtv.shieldtv.heartbeat.label = Heartbeat Frequency
|
thing-type.config.androidtv.shieldtv.heartbeat.label = Heartbeat Frequency
|
||||||
thing-type.config.androidtv.shieldtv.heartbeat.description = Frequency of heartbeats
|
thing-type.config.androidtv.shieldtv.heartbeat.description = Frequency of heartbeats
|
||||||
thing-type.config.androidtv.shieldtv.ipAddress.label = Hostname
|
thing-type.config.androidtv.shieldtv.ipAddress.label = Hostname
|
||||||
@ -63,6 +67,7 @@ channel-type.androidtv.player.label = Player
|
|||||||
channel-type.androidtv.player.description = Player Control
|
channel-type.androidtv.player.description = Player Control
|
||||||
|
|
||||||
# custom thing status
|
# custom thing status
|
||||||
|
|
||||||
offline.protocols-starting = Protocols Starting
|
offline.protocols-starting = Protocols Starting
|
||||||
offline.googletv-address-not-specified = googletv address not specified
|
offline.googletv-address-not-specified = googletv address not specified
|
||||||
offline.shieldtv-address-not-specified = shieldtv address not specified
|
offline.shieldtv-address-not-specified = shieldtv address not specified
|
||||||
@ -81,4 +86,3 @@ offline.runtime-exception = Runtime exception
|
|||||||
offline.user-forced-pin-process = User Forced PIN Process
|
offline.user-forced-pin-process = User Forced PIN Process
|
||||||
offline.unknown = Unknown
|
offline.unknown = Unknown
|
||||||
online.online = Online
|
online.online = Online
|
||||||
|
|
||||||
|
@ -71,6 +71,11 @@
|
|||||||
<description>Delay between messages</description>
|
<description>Delay between messages</description>
|
||||||
<default>0</default>
|
<default>0</default>
|
||||||
</parameter>
|
</parameter>
|
||||||
|
<parameter name="gtvEnabled" type="boolean">
|
||||||
|
<label>Enable GoogleTV</label>
|
||||||
|
<description>Enable the GoogleTV Protocol</description>
|
||||||
|
<default>true</default>
|
||||||
|
</parameter>
|
||||||
</config-description>
|
</config-description>
|
||||||
|
|
||||||
</thing-type>
|
</thing-type>
|
||||||
@ -137,6 +142,11 @@
|
|||||||
<description>Delay between messages</description>
|
<description>Delay between messages</description>
|
||||||
<default>0</default>
|
<default>0</default>
|
||||||
</parameter>
|
</parameter>
|
||||||
|
<parameter name="gtvEnabled" type="boolean">
|
||||||
|
<label>Enable GoogleTV</label>
|
||||||
|
<description>Enable the GoogleTV Protocol</description>
|
||||||
|
<default>true</default>
|
||||||
|
</parameter>
|
||||||
</config-description>
|
</config-description>
|
||||||
|
|
||||||
</thing-type>
|
</thing-type>
|
||||||
|
Loading…
Reference in New Issue
Block a user