Skip to content

Commit 79bb8e0

Browse files
committed
Don't int(0)
1 parent 14374bf commit 79bb8e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugwise/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def escape_illegal_xml_characters(xmldata):
7373

7474
def format_measure(measure, unit):
7575
"""Format measure to correct type."""
76-
if unit == PERCENTAGE:
76+
if unit == PERCENTAGE and measure > 0:
7777
measure = int(measure * 100)
7878
if unit == ENERGY_KILO_WATT_HOUR:
7979
measure = measure / 1000

0 commit comments

Comments
 (0)