We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79bb8e0 commit ef52e08Copy full SHA for ef52e08
plugwise/util.py
@@ -73,10 +73,10 @@ def escape_illegal_xml_characters(xmldata):
73
74
def format_measure(measure, unit):
75
"""Format measure to correct type."""
76
- if unit == PERCENTAGE and measure > 0:
77
- measure = int(measure * 100)
+ if unit == PERCENTAGE and float(measure) > 0:
+ measure = int(float(measure) * 100)
78
if unit == ENERGY_KILO_WATT_HOUR:
79
- measure = measure / 1000
+ measure = float(measure) / 1000
80
try:
81
measure = int(measure)
82
except ValueError:
0 commit comments