[amazonechocontrol] HandlerTemperatureSensor: increase resolution (#9246)
Signed-off-by: Sven Killig <sven@killig.de>
This commit is contained in:
@@ -12,8 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.openhab.binding.amazonechocontrol.internal.smarthome;
|
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.*;
|
||||||
import static org.openhab.binding.amazonechocontrol.internal.smarthome.Constants.ITEM_TYPE_NUMBER_TEMPERATURE;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -71,7 +70,7 @@ public class HandlerTemperatureSensor extends HandlerBase {
|
|||||||
JsonObject value = state.get("value").getAsJsonObject();
|
JsonObject value = state.get("value").getAsJsonObject();
|
||||||
// For groups take the first
|
// For groups take the first
|
||||||
if (temperatureValue == null) {
|
if (temperatureValue == null) {
|
||||||
int temperature = value.get("value").getAsInt();
|
float temperature = value.get("value").getAsFloat();
|
||||||
String scale = value.get("scale").getAsString();
|
String scale = value.get("scale").getAsString();
|
||||||
if ("CELSIUS".equals(scale)) {
|
if ("CELSIUS".equals(scale)) {
|
||||||
temperatureValue = new QuantityType<Temperature>(temperature, SIUnits.CELSIUS);
|
temperatureValue = new QuantityType<Temperature>(temperature, SIUnits.CELSIUS);
|
||||||
|
|||||||
Reference in New Issue
Block a user