Skip to content

Commit 2258bb6

Browse files
committed
Reorder
1 parent 9cf798a commit 2258bb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugwise/helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ def power_data_local_format(
161161
) -> float | int | bool:
162162
"""Format power data."""
163163
# Special formatting of P1_MEASUREMENT POWER_WATT values, do not move to util-format_measure() function!
164-
if (attrs_uom := getattr(attrs, ATTR_UNIT_OF_MEASUREMENT)) == POWER_WATT:
165-
return int(round(float(val)))
166164
if all(item in key_string for item in ("electricity", "cumulative")):
167165
return format_measure(val, ENERGY_KILO_WATT_HOUR)
166+
if (attrs_uom := getattr(attrs, ATTR_UNIT_OF_MEASUREMENT)) == POWER_WATT:
167+
return int(round(float(val)))
168168

169169
return format_measure(val, attrs_uom)
170170

0 commit comments

Comments
 (0)