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
@@ -10,7 +10,8 @@ import requests
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import CONF_CURRENCY, POWER_WATT
|
||||
from homeassistant.const import (CONF_CURRENCY, POWER_WATT,
|
||||
ENERGY_KILO_WATT_HOUR)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
@@ -35,7 +36,7 @@ DEFAULT_UTC_OFFSET = '0'
|
||||
|
||||
SENSOR_TYPES = {
|
||||
CONF_INSTANT: ['Energy Usage', POWER_WATT],
|
||||
CONF_AMOUNT: ['Energy Consumed', 'kWh'],
|
||||
CONF_AMOUNT: ['Energy Consumed', ENERGY_KILO_WATT_HOUR],
|
||||
CONF_BUDGET: ['Energy Budget', None],
|
||||
CONF_COST: ['Energy Cost', None],
|
||||
CONF_CURRENT_VALUES: ['Per-Device Usage', POWER_WATT]
|
||||
|
||||
Reference in new issue
Block a user