From dbc663d12f4b29211e07b52ae77ecde27542b74f Mon Sep 17 00:00:00 2001 From: Martin Herbst Date: Wed, 29 Dec 2021 14:33:06 +0100 Subject: [PATCH] Explicit conversion to double value added Fixes #11886 Signed-off-by: Martin Herbst --- .../openhab/binding/shelly/internal/api/ShellyHttpApi.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyHttpApi.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyHttpApi.java index 13c5b8ede95e..ea64fda12c71 100644 --- a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyHttpApi.java +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyHttpApi.java @@ -199,8 +199,8 @@ public ShellyStatusSensor getSensorStatus() throws ShellyApiException { status.tmp.tC = status.tmp.units.equals(SHELLY_TEMP_CELSIUS) ? status.tmp.value : ImperialUnits.FAHRENHEIT.getConverterTo(SIUnits.CELSIUS).convert(getDouble(status.tmp.value)) .doubleValue(); - double f = (double) SIUnits.CELSIUS.getConverterTo(ImperialUnits.FAHRENHEIT) - .convert(getDouble(status.tmp.value)); + double f = SIUnits.CELSIUS.getConverterTo(ImperialUnits.FAHRENHEIT).convert(getDouble(status.tmp.value)) + .doubleValue(); status.tmp.tF = status.tmp.units.equals(SHELLY_TEMP_FAHRENHEIT) ? status.tmp.value : f; } if ((status.charger == null) && (profile.settings.externalPower != null)) {