Skip to content

Commit 11ca3eb

Browse files
committed
Format degrees C int's as float
1 parent 2e7e17e commit 11ca3eb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

plugwise/util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
LOGADDR_OFFSET,
1919
PERCENTAGE,
2020
PLUGWISE_EPOCH,
21+
TEMP_CELSIUS,
2122
UTF8_DECODE,
2223
VOLUME_CUBIC_METERS,
2324
)
@@ -98,6 +99,8 @@ def format_measure(measure: str, unit: str) -> float | int | bool:
9899
"""Format measure to correct type."""
99100
try:
100101
measure = int(measure)
102+
if unit == TEMP_CELSIUS:
103+
measure = float(measure)
101104
except ValueError:
102105
if unit == PERCENTAGE:
103106
if 0 < float(measure) <= 1:

0 commit comments

Comments
 (0)