[samsungtv] Fix for incorrect PowerState (#17715)

Signed-off-by: Nick Waterton <n.waterton@outlook.com>
This commit is contained in:
Nick Waterton 2024-11-07 08:24:38 -05:00 committed by GitHub
parent 6d9cc49baa
commit b7380b5cc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
@ -143,22 +143,22 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
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() {