Centrally define Watt (#21570)

* centralize Watt definition

* lint
This commit is contained in:
Diogo Gomes authored and Daniel Høyer Iversen committed 2019-03-02 11:29:59 +01:00
1 parent e55ce61100
commit ed2b9e5483
26 files changed
+70 -58

No files matched your search

+3 -3
View File
@@ -10,7 +10,7 @@ import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_CURRENCY
from homeassistant.const import CONF_CURRENCY, POWER_WATT
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@@ -34,11 +34,11 @@ DEFAULT_PERIOD = 'year'
DEFAULT_UTC_OFFSET = '0'
SENSOR_TYPES = {
CONF_INSTANT: ['Energy Usage', 'W'],
CONF_INSTANT: ['Energy Usage', POWER_WATT],
CONF_AMOUNT: ['Energy Consumed', 'kWh'],
CONF_BUDGET: ['Energy Budget', None],
CONF_COST: ['Energy Cost', None],
CONF_CURRENT_VALUES: ['Per-Device Usage', 'W']
CONF_CURRENT_VALUES: ['Per-Device Usage', POWER_WATT]
}
TYPES_SCHEMA = vol.In(SENSOR_TYPES)