[androidtv] Removes unnecessary null checks (#15331)

* Removes unnecessary null checks
* Moves checks to thing-types.xml
* Fix typo
* Update i18n

Signed-off-by: Ben Rosenblum <rosenblumb@gmail.com>
This commit is contained in:
morph166955 2023-07-30 12:23:04 -05:00 committed by GitHub
parent bf7f24c099
commit 6115cd39a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 18 deletions

View File

@ -462,11 +462,6 @@ public class GoogleTVConnectionManager {
}
config.port = (config.port > 0) ? config.port : DEFAULT_PORT;
config.reconnect = (config.reconnect > 0) ? config.reconnect : DEFAULT_RECONNECT_SECONDS;
config.heartbeat = (config.heartbeat > 0) ? config.heartbeat : DEFAULT_HEARTBEAT_SECONDS;
config.delay = (config.delay < 0) ? 0 : config.delay;
config.shim = (config.shim) ? true : false;
config.shimNewKeys = (config.shimNewKeys) ? true : false;
config.mode = (!config.mode.equals("")) ? config.mode : DEFAULT_MODE;
config.keystoreFileName = (!config.keystoreFileName.equals("")) ? config.keystoreFileName

View File

@ -358,11 +358,6 @@ public class ShieldTVConnectionManager {
}
config.port = (config.port > 0) ? config.port : DEFAULT_PORT;
config.reconnect = (config.reconnect > 0) ? config.reconnect : DEFAULT_RECONNECT_SECONDS;
config.heartbeat = (config.heartbeat > 0) ? config.heartbeat : DEFAULT_HEARTBEAT_SECONDS;
config.delay = (config.delay < 0) ? 0 : config.delay;
config.shim = (config.shim) ? true : false;
config.shimNewKeys = (config.shimNewKeys) ? true : false;
config.keystoreFileName = (!config.keystoreFileName.equals("")) ? config.keystoreFileName
: folderName + "/shieldtv." + ((config.shim) ? "shim." : "") + handler.getThing().getUID().getId()

View File

@ -28,7 +28,7 @@ thing-type.config.androidtv.googletv.reconnect.label = Reconnect Delay
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.description = Delay between messages
thing-type.config.androidtv.shieldtv.heartbeat.label = Hearbeat 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.ipAddress.label = Hostname
thing-type.config.androidtv.shieldtv.ipAddress.description = Hostname or IP address of the device

View File

@ -56,17 +56,20 @@
<label>Keystore Password</label>
<description>Password for the keystore file</description>
</parameter>
<parameter name="reconnect" type="integer">
<parameter name="reconnect" type="integer" min="0">
<label>Reconnect Delay</label>
<description>Delay between reconnection attempts</description>
<default>60</default>
</parameter>
<parameter name="heartbeat" type="integer">
<label>Hearbeat Frequency</label>
<parameter name="heartbeat" type="integer" min="0">
<label>Heartbeat Frequency</label>
<description>Frequency of heartbeats</description>
<default>5</default>
</parameter>
<parameter name="delay" type="integer">
<parameter name="delay" type="integer" min="0">
<label>Delay</label>
<description>Delay between messages</description>
<default>0</default>
</parameter>
</config-description>
@ -119,17 +122,20 @@
<label>Keystore Password</label>
<description>Password for the keystore file</description>
</parameter>
<parameter name="reconnect" type="integer">
<parameter name="reconnect" type="integer" min="0">
<label>Reconnect Delay</label>
<description>Delay between reconnection attempts</description>
<default>60</default>
</parameter>
<parameter name="heartbeat" type="integer">
<parameter name="heartbeat" type="integer" min="0">
<label>Heartbeat Frequency</label>
<description>Frequency of heartbeats</description>
<default>5</default>
</parameter>
<parameter name="delay" type="integer">
<parameter name="delay" type="integer" min="0">
<label>Delay</label>
<description>Delay between messages</description>
<default>0</default>
</parameter>
</config-description>