Skip to content

Commit

Permalink
[androidtv] Removes unnecessary null checks (openhab#15331)
Browse files Browse the repository at this point in the history
* Removes unnecessary null checks
* Moves checks to thing-types.xml
* Fix typo
* Update i18n

Signed-off-by: Ben Rosenblum <[email protected]>
  • Loading branch information
morph166955 authored Jul 30, 2023
1 parent bf7f24c commit 6115cd3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,6 @@ private void initialize() {
}

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,6 @@ private void initialize() {
}

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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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>

Expand Down

0 comments on commit 6115cd3

Please sign in to comment.