From: Fabian Fagerholm Date: Sun, 12 May 2024 10:06:23 +0000 (+0300) Subject: Enable use of analogue input with Shelly Plus Add-on (#16744) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=8b85ff1db50e801f5315a2bcbd2564257583a4ec;p=openhab-addons.git Enable use of analogue input with Shelly Plus Add-on (#16744) Signed-off-by: Fabian Fagerholm --- diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api2/Shelly2ApiClient.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api2/Shelly2ApiClient.java index f1705abac4..de9d40755b 100644 --- a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api2/Shelly2ApiClient.java +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api2/Shelly2ApiClient.java @@ -620,7 +620,11 @@ public class Shelly2ApiClient extends ShellyHttpClient { status.extVoltage = new ShellyExtVoltage(ds.voltmeter100.voltage); } if (ds.input100 != null) { - status.extDigitalInput = new ShellyExtDigitalInput(getBool(ds.input100.state)); + if (ds.input100.state != null) { + status.extDigitalInput = new ShellyExtDigitalInput(getBool(ds.input100.state)); + } else if (ds.input100.percent != null) { + status.extAnalogInput = new ShellyExtAnalogInput(getDouble(ds.input100.percent)); + } } }