Skip to content

Commit

Permalink
fixed estimatedrange conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Kreuzer <kai@openhab.org>
  • Loading branch information
kaikreuzer committed Nov 10, 2019
1 parent dbc2c26 commit 9113643
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,7 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str
public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) {
State someState = super.getState(s);
BigDecimal value = ((DecimalType) someState).toBigDecimal();
if (properties.containsKey("distanceunits") && properties.get("distanceunits").equals("km/hr")) {
return new QuantityType<>(value, MetricPrefix.KILO(SIUnits.METRE));
} else {
return new QuantityType<>(value, ImperialUnits.MILE);
}
return new QuantityType<>(value, ImperialUnits.MILE);
}
},
EU_VEHICLE("eu_vehicle", "european", OnOffType.class, true) {
Expand Down

0 comments on commit 9113643

Please sign in to comment.