Centrally define Energy Units (kWh and Wh) (#21719)

* centralize energy units kWh and Wh

* lint
This commit is contained in:
Diogo Gomes authored and Robbie Trencheny committed 2019-03-12 18:46:41 -07:00
1 parent c0b859d8da
commit a99d83390e
19 files changed
+70 -51

No files matched your search

+3 -2
View File
@@ -7,7 +7,8 @@ from homeassistant.components.fritzbox import DOMAIN as FRITZBOX_DOMAIN
from homeassistant.components.fritzbox import (
ATTR_STATE_DEVICE_LOCKED, ATTR_STATE_LOCKED)
from homeassistant.components.switch import SwitchDevice
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS
from homeassistant.const import (ATTR_TEMPERATURE, TEMP_CELSIUS,
ENERGY_KILO_WATT_HOUR)
DEPENDENCIES = ['fritzbox']
@@ -15,7 +16,7 @@ _LOGGER = logging.getLogger(__name__)
ATTR_TOTAL_CONSUMPTION = 'total_consumption'
ATTR_TOTAL_CONSUMPTION_UNIT = 'total_consumption_unit'
ATTR_TOTAL_CONSUMPTION_UNIT_VALUE = 'kWh'
ATTR_TOTAL_CONSUMPTION_UNIT_VALUE = ENERGY_KILO_WATT_HOUR
ATTR_TEMPERATURE_UNIT = 'temperature_unit'