[openhabcloud] Makes the baseURL and item updates options advanced... (#13078)

* [openhabcloud] Makes the baseURL and item updates options advanced, cleans up documentation, disabled sending updates to the community myopenHAB.org service.

Fixes #12582

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
This commit is contained in:
Dan Cunningham
2022-07-04 14:09:35 -07:00
committed by GitHub
parent a58ae57942
commit 8a87450f4c
5 changed files with 21 additions and 11 deletions

View File

@@ -367,8 +367,12 @@ public class CloudService implements ActionService, CloudClientListener, EventSu
@Override
public void receive(Event event) {
ItemStateEvent ise = (ItemStateEvent) event;
if (exposedItems != null && exposedItems.contains(ise.getItemName())) {
if (supportsUpdates() && exposedItems != null && exposedItems.contains(ise.getItemName())) {
cloudClient.sendItemUpdate(ise.getItemName(), ise.getItemState().toString());
}
}
private boolean supportsUpdates() {
return cloudBaseUrl.indexOf(CFG_BASE_URL) >= 0;
}
}

View File

@@ -16,13 +16,16 @@
</parameter>
<parameter name="expose" type="text" required="false" multiple="true">
<label>Items to Expose</label>
<description>List of items that are made accessible to IFTTT and similar services.</description>
<description>List of items that are made accessible to IFTTT and similar services. Only supported on private cloud
installations.</description>
<context>item</context>
<advanced>true</advanced>
</parameter>
<parameter name="baseURL" type="text" required="false">
<label>Base URL</label>
<description>Base URL for the openHAB Cloud server.</description>
<default>https://myopenhab.org/</default>
<advanced>true</advanced>
</parameter>
</config-description>
</config-description:config-descriptions>

View File

@@ -1,7 +1,7 @@
io.config.openhabcloud.baseURL.label = Base URL
io.config.openhabcloud.baseURL.description = Base URL for the openHAB Cloud server.
io.config.openhabcloud.expose.label = Items to Expose
io.config.openhabcloud.expose.description = List of items that are made accessible to IFTTT and similar services.
io.config.openhabcloud.expose.description = List of items that are made accessible to IFTTT and similar services. Only supported on private cloud installations.
io.config.openhabcloud.mode.label = Mode
io.config.openhabcloud.mode.description = What features of the openHAB Cloud service should be used.
io.config.openhabcloud.mode.option.notification = Notifications