diff --git a/bundles/org.openhab.binding.lgwebos/README.md b/bundles/org.openhab.binding.lgwebos/README.md index f8e431e055bc5..3610bfd2b5191 100644 --- a/bundles/org.openhab.binding.lgwebos/README.md +++ b/bundles/org.openhab.binding.lgwebos/README.md @@ -97,17 +97,19 @@ A sample HABPanel remote control widget can be found [in this github repository. ## Console Commands -The binding provides two specific commands you can use in the console. +The binding provides a few commands you can use in the console. Enter the command `lgwebos` to get the usage. ``` openhab> lgwebos Usage: smarthome:lgwebos applications - list applications Usage: smarthome:lgwebos channels - list channels +Usage: smarthome:lgwebos accesskey - show the access key ``` The command `applications` reports in the console the list of all applications with their id and name. The command `channels` reports in the console the list of all channels with their id, number and name. +The command `accesskey` reports in the console the access key used to connect to your TV. ## Example diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/console/LGWebOSCommandExtension.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/console/LGWebOSCommandExtension.java index 5afe219ee1e30..06f343cb548b0 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/console/LGWebOSCommandExtension.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/console/LGWebOSCommandExtension.java @@ -39,6 +39,7 @@ public class LGWebOSCommandExtension extends AbstractConsoleCommandExtension { private static final String APPLICATIONS = "applications"; private static final String CHANNELS = "channels"; + private static final String ACCESS_KEY = "accesskey"; private final ThingRegistry thingRegistry; @@ -72,6 +73,9 @@ public void execute(String[] args, Console console) { case CHANNELS: handler.reportChannels().forEach(console::println); break; + case ACCESS_KEY: + console.println("Your access key is " + handler.getKey()); + break; default: printUsage(console); break; @@ -85,6 +89,7 @@ public void execute(String[] args, Console console) { @Override public List getUsages() { return Arrays.asList(new String[] { buildCommandUsage(" " + APPLICATIONS, "list applications"), - buildCommandUsage(" " + CHANNELS, "list channels") }); + buildCommandUsage(" " + CHANNELS, "list channels"), + buildCommandUsage(" " + ACCESS_KEY, "show the access key") }); } } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSHandler.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSHandler.java index d72f87934a34b..71437142569a6 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSHandler.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSHandler.java @@ -256,7 +256,7 @@ public String getKey() { @Override public void storeKey(@Nullable String key) { if (!getKey().equals(key)) { - logger.info("Store {} as access Key in the thing configuration", key); + logger.debug("Store new access Key in the thing configuration"); // store it current configuration and avoiding complete re-initialization via handleConfigurationUpdate getLGWebOSConfig().key = key;