Skip to content

Commit 8568e93

Browse files
committed
Update format_measure() for ELECTRIC_POTENTIAL_VOLT
1 parent fbca90b commit 8568e93

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
@@ -14,6 +14,7 @@
1414

1515
from .constants import (
1616
ARBITRARY_DATE,
17+
ELECTRIC_POTENTIAL_VOLT,
1718
ENERGY_KILO_WATT_HOUR,
1819
HW_MODELS,
1920
LOGADDR_OFFSET,
@@ -118,6 +119,8 @@ def format_measure(measure: str, unit: str) -> float | int | bool:
118119

119120
if unit in SPECIAL_FORMAT:
120121
result = float(f"{round(float_measure, 3):.3f}")
122+
elif unit == ELECTRIC_POTENTIAL_VOLT:
123+
result = float(f"{round(float_measure, 1):.1f}")
121124
else:
122125
if abs(float_measure) < 10:
123126
result = float(f"{round(float_measure, 2):.2f}")

0 commit comments

Comments
 (0)