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 9cf798a commit 2258bb6Copy full SHA for 2258bb6
plugwise/helper.py
@@ -161,10 +161,10 @@ def power_data_local_format(
161
) -> float | int | bool:
162
"""Format power data."""
163
# 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)))
166
if all(item in key_string for item in ("electricity", "cumulative")):
167
return format_measure(val, ENERGY_KILO_WATT_HOUR)
+ if (attrs_uom := getattr(attrs, ATTR_UNIT_OF_MEASUREMENT)) == POWER_WATT:
+ return int(round(float(val)))
168
169
return format_measure(val, attrs_uom)
170
0 commit comments