From b041511f4c97a65bdfba0fbd1b6f45f43924967f Mon Sep 17 00:00:00 2001 From: Fabian Fagerholm Date: Sun, 12 May 2024 13:06:23 +0300 Subject: [PATCH] Enable use of analogue input with Shelly Plus Add-on (#16744) Signed-off-by: Fabian Fagerholm Signed-off-by: Ciprian Pascu --- .../binding/shelly/internal/api2/Shelly2ApiClient.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 f1705abac41..de9d40755b3 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)); + } } }