[amazonechocontrol] HandlerTemperatureSensor: increase resolution (#9246)

Signed-off-by: Sven Killig <sven@killig.de>
This commit is contained in:
Sven Killig 2020-12-06 18:31:47 +01:00 committed by GitHub
parent f199142ef8
commit 4fafb06251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,8 +12,7 @@
*/
package org.openhab.binding.amazonechocontrol.internal.smarthome;
import static org.openhab.binding.amazonechocontrol.internal.smarthome.Constants.CHANNEL_TYPE_TEMPERATURE;
import static org.openhab.binding.amazonechocontrol.internal.smarthome.Constants.ITEM_TYPE_NUMBER_TEMPERATURE;
import static org.openhab.binding.amazonechocontrol.internal.smarthome.Constants.*;
import java.io.IOException;
import java.util.List;
@ -71,7 +70,7 @@ public class HandlerTemperatureSensor extends HandlerBase {
JsonObject value = state.get("value").getAsJsonObject();
// For groups take the first
if (temperatureValue == null) {
int temperature = value.get("value").getAsInt();
float temperature = value.get("value").getAsFloat();
String scale = value.get("scale").getAsString();
if ("CELSIUS".equals(scale)) {
temperatureValue = new QuantityType<Temperature>(temperature, SIUnits.CELSIUS);