Skip to content

Commit

Permalink
[samsungtv@] Removed dependency on 'org.apache.commons.lang'
Browse files Browse the repository at this point in the history
Relative to openhab#7722

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo committed May 22, 2020
1 parent 5102cdd commit 83de551
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

import org.apache.commons.lang.StringUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.smarthome.config.discovery.DiscoveryListener;
Expand Down Expand Up @@ -338,7 +337,7 @@ public void thingDiscovered(DiscoveryService source, DiscoveryResult result) {
result);

/* Check if configuration should be updated */
if (StringUtils.isEmpty(configuration.macAddress)) {
if (configuration.macAddress == null || configuration.macAddress.trim().isEmpty()) {
String macAddress = WakeOnLanUtility.getMACAddress(configuration.hostName);
if (macAddress != null) {
putConfig(SamsungTvConfiguration.MAC_ADDRESS, macAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package org.openhab.binding.samsungtv.internal.protocol;

import org.apache.commons.lang.StringUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.slf4j.Logger;
Expand Down Expand Up @@ -109,14 +108,17 @@ public void onWebSocketText(@Nullable String msgarg) {
}

private void handleResult(JSONMessage jsonMsg) {
if (StringUtils.isBlank(remoteControllerWebSocket.currentSourceApp) && "true".equals(jsonMsg.result.visible)) {
if ((remoteControllerWebSocket.currentSourceApp == null
|| remoteControllerWebSocket.currentSourceApp.trim().isEmpty())
&& "true".equals(jsonMsg.result.visible)) {
logger.debug("Running app: {} = {}", jsonMsg.result.id, jsonMsg.result.name);
remoteControllerWebSocket.currentSourceApp = jsonMsg.result.name;
remoteControllerWebSocket.callback.currentAppUpdated(remoteControllerWebSocket.currentSourceApp);
}

if (remoteControllerWebSocket.lastApp != null && remoteControllerWebSocket.lastApp.equals(jsonMsg.result.id)) {
if (StringUtils.isBlank(remoteControllerWebSocket.currentSourceApp)) {
if (remoteControllerWebSocket.currentSourceApp == null
|| remoteControllerWebSocket.currentSourceApp.trim().isEmpty()) {
remoteControllerWebSocket.callback.currentAppUpdated("");
}
remoteControllerWebSocket.lastApp = null;
Expand Down

0 comments on commit 83de551

Please sign in to comment.