Enable use of analogue input with Shelly Plus Add-on (#16744)

Signed-off-by: Fabian Fagerholm <fabbe@paniq.net>
This commit is contained in:
Fabian Fagerholm 2024-05-12 13:06:23 +03:00 committed by GitHub
parent 1caf5ff547
commit 8b85ff1db5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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));
}
}
}