Centrally define Energy Units (kWh and Wh) (#21719)
* centralize energy units kWh and Wh * lint
This commit is contained in:
1 parent
c0b859d8da
commit
a99d83390e
19 files changed
+70
-51
No files matched your search
@@ -3,7 +3,7 @@ from datetime import timedelta
|
||||
import logging
|
||||
|
||||
from homeassistant.components.sense import SENSE_DATA
|
||||
from homeassistant.const import POWER_WATT
|
||||
from homeassistant.const import POWER_WATT, ENERGY_KILO_WATT_HOUR
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
@@ -91,7 +91,7 @@ class Sense(Entity):
|
||||
if sensor_type == ACTIVE_TYPE:
|
||||
self._unit_of_measurement = POWER_WATT
|
||||
else:
|
||||
self._unit_of_measurement = 'kWh'
|
||||
self._unit_of_measurement = ENERGY_KILO_WATT_HOUR
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
||||
Reference in new issue
Block a user