Skip to content

Commit 3312e45

Browse files
authored
Merge pull request #47 from CoMPaTech/unitfix
Correct unit
2 parents 30108f4 + a5f8527 commit 3312e45

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ Even though available does not mean it's stable yet, the HA part is solid but th
120120

121121
# Changelog
122122

123+
## NOV 2023 [0.2.5]
124+
- Fix unit from W to Wh (thanks @Tinus78) via #46
125+
123126
## OCT 2023 [0.2.4]
124127
- Improve quality
125128

custom_components/stromer/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"iot_class": "cloud_polling",
88
"issue_tracker": "https://github.com/CoMPaTech/stromer/issues",
99
"requirements": [],
10-
"version": "0.2.4"
10+
"version": "0.2.5"
1111
}

custom_components/stromer/sensor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from homeassistant.components.sensor import (SensorDeviceClass, SensorEntity,
55
SensorEntityDescription,
66
SensorStateClass)
7-
from homeassistant.const import (LENGTH_KILOMETERS, PERCENTAGE, POWER_WATT,
7+
from homeassistant.const import (ENERGY_WATT_HOUR, LENGTH_KILOMETERS, PERCENTAGE, POWER_WATT,
88
PRESSURE_BAR, SPEED_KILOMETERS_PER_HOUR,
99
TEMP_CELSIUS, TIME_SECONDS)
1010
from homeassistant.helpers.entity import EntityCategory
@@ -33,7 +33,7 @@
3333
SensorEntityDescription(
3434
key="average_energy_consumption",
3535
name="Energy used (average)",
36-
native_unit_of_measurement=POWER_WATT,
36+
native_unit_of_measurement=ENERGY_WATT_HOUR,
3737
device_class=SensorDeviceClass.POWER,
3838
state_class=SensorStateClass.MEASUREMENT,
3939
),
@@ -110,7 +110,7 @@
110110
SensorEntityDescription(
111111
key="total_energy_consumption",
112112
name="Energy used (total)",
113-
native_unit_of_measurement=POWER_WATT,
113+
native_unit_of_measurement=ENERGY_WATT_HOUR,
114114
device_class=SensorDeviceClass.POWER,
115115
state_class=SensorStateClass.MEASUREMENT,
116116
),

0 commit comments

Comments
 (0)