Skip to content

Commit

Permalink
[amazonechocontrol] HandlerTemperatureSensor: increase resolution (#9246
Browse files Browse the repository at this point in the history
)

Signed-off-by: Sven Killig <sven@killig.de>
Signed-off-by: Christian Grasser <info@christiangrasser.at>
  • Loading branch information
sonic74 authored and Christian Grasser committed Dec 7, 2020
1 parent 579610b commit eb4a4de
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -71,7 +70,7 @@ public void updateChannels(String interfaceName, List<JsonObject> stateList, Upd
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);
Expand Down

0 comments on commit eb4a4de

Please sign in to comment.