Skip to content

Commit

Permalink
[samsungtv] Fix for incorrect PowerState (#17715)
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Waterton <[email protected]>
  • Loading branch information
NickWaterton authored Nov 7, 2024
1 parent 6d9cc49 commit b7380b5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ...sungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
@NonNullByDefault({})
public class TVProperties {
class Device {
boolean frameTVSupport;
boolean gamePadSupport;
boolean imeSyncedSupport;
String oS;
String powerState;
boolean tokenAuthSupport;
boolean voiceSupport;
boolean FrameTVSupport;
boolean GamePadSupport;
boolean ImeSyncedSupport;
String OS;
String PowerState;
boolean TokenAuthSupport;
boolean VoiceSupport;
String countryCode;
String description;
String firmwareVersion;
Expand All @@ -143,22 +143,22 @@ class Device {
String isSupport;

public boolean getFrameTVSupport() {
return Optional.ofNullable(device).map(a -> a.frameTVSupport).orElse(false);
return Optional.ofNullable(device).map(a -> a.FrameTVSupport).orElse(false);
}

public boolean getTokenAuthSupport() {
return Optional.ofNullable(device).map(a -> a.tokenAuthSupport).orElse(false);
return Optional.ofNullable(device).map(a -> a.TokenAuthSupport).orElse(false);
}

public String getPowerState() {
if (!getOS().isBlank()) {
return Optional.ofNullable(device).map(a -> a.powerState).orElse("on");
return Optional.ofNullable(device).map(a -> a.PowerState).orElse("on");
}
return "off";
}

public String getOS() {
return Optional.ofNullable(device).map(a -> a.oS).orElse("");
return Optional.ofNullable(device).map(a -> a.OS).orElse("");
}

public String getWifiMac() {
Expand Down

0 comments on commit b7380b5

Please sign in to comment.