mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-27 07:41:39 +01:00
[samsungtv] Fix for incorrect PowerState (#17715)
Signed-off-by: Nick Waterton <n.waterton@outlook.com> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
5f0e3c438c
commit
aa58d58009
22
bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java
Normal file → Executable file
22
bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java
Normal file → Executable file
@ -120,13 +120,13 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
|||||||
@NonNullByDefault({})
|
@NonNullByDefault({})
|
||||||
public class TVProperties {
|
public class TVProperties {
|
||||||
class Device {
|
class Device {
|
||||||
boolean frameTVSupport;
|
boolean FrameTVSupport;
|
||||||
boolean gamePadSupport;
|
boolean GamePadSupport;
|
||||||
boolean imeSyncedSupport;
|
boolean ImeSyncedSupport;
|
||||||
String oS;
|
String OS;
|
||||||
String powerState;
|
String PowerState;
|
||||||
boolean tokenAuthSupport;
|
boolean TokenAuthSupport;
|
||||||
boolean voiceSupport;
|
boolean VoiceSupport;
|
||||||
String countryCode;
|
String countryCode;
|
||||||
String description;
|
String description;
|
||||||
String firmwareVersion;
|
String firmwareVersion;
|
||||||
@ -143,22 +143,22 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
|||||||
String isSupport;
|
String isSupport;
|
||||||
|
|
||||||
public boolean getFrameTVSupport() {
|
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() {
|
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() {
|
public String getPowerState() {
|
||||||
if (!getOS().isBlank()) {
|
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";
|
return "off";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOS() {
|
public String getOS() {
|
||||||
return Optional.ofNullable(device).map(a -> a.oS).orElse("");
|
return Optional.ofNullable(device).map(a -> a.OS).orElse("");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getWifiMac() {
|
public String getWifiMac() {
|
||||||
|
Loading…
Reference in New Issue
Block a user