Skip to content

Commit

Permalink
Merge pull request #47 from CoMPaTech/unitfix
Browse files Browse the repository at this point in the history
Correct unit
  • Loading branch information
CoMPaTech authored Nov 4, 2023
2 parents 30108f4 + a5f8527 commit 3312e45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ Even though available does not mean it's stable yet, the HA part is solid but th

# Changelog

## NOV 2023 [0.2.5]
- Fix unit from W to Wh (thanks @Tinus78) via #46

## OCT 2023 [0.2.4]
- Improve quality

Expand Down
2 changes: 1 addition & 1 deletion custom_components/stromer/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/CoMPaTech/stromer/issues",
"requirements": [],
"version": "0.2.4"
"version": "0.2.5"
}
6 changes: 3 additions & 3 deletions custom_components/stromer/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from homeassistant.components.sensor import (SensorDeviceClass, SensorEntity,
SensorEntityDescription,
SensorStateClass)
from homeassistant.const import (LENGTH_KILOMETERS, PERCENTAGE, POWER_WATT,
from homeassistant.const import (ENERGY_WATT_HOUR, LENGTH_KILOMETERS, PERCENTAGE, POWER_WATT,
PRESSURE_BAR, SPEED_KILOMETERS_PER_HOUR,
TEMP_CELSIUS, TIME_SECONDS)
from homeassistant.helpers.entity import EntityCategory
Expand Down Expand Up @@ -33,7 +33,7 @@
SensorEntityDescription(
key="average_energy_consumption",
name="Energy used (average)",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=ENERGY_WATT_HOUR,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
Expand Down Expand Up @@ -110,7 +110,7 @@
SensorEntityDescription(
key="total_energy_consumption",
name="Energy used (total)",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=ENERGY_WATT_HOUR,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
Expand Down

0 comments on commit 3312e45

Please sign in to comment.