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

* centralize energy units kWh and Wh

* lint
This commit is contained in:
Diogo Gomes 2019-03-13 01:46:41 +00:00 committed by Robbie Trencheny
parent c0b859d8da
commit a99d83390e
19 changed files with 70 additions and 51 deletions

View file

@ -1,7 +1,8 @@
"""Support for MySensors sensors."""
from homeassistant.components import mysensors
from homeassistant.components.sensor import DOMAIN
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT, POWER_WATT
from homeassistant.const import (TEMP_CELSIUS, TEMP_FAHRENHEIT, POWER_WATT,
ENERGY_KILO_WATT_HOUR)
SENSORS = {
'V_TEMP': [None, 'mdi:thermometer'],
@ -13,7 +14,7 @@ SENSORS = {
'V_DISTANCE': ['m', 'mdi:ruler'],
'V_IMPEDANCE': ['ohm', None],
'V_WATT': [POWER_WATT, None],
'V_KWH': ['kWh', None],
'V_KWH': [ENERGY_KILO_WATT_HOUR, None],
'V_FLOW': ['m', None],
'V_VOLUME': ['', None],
'V_VOLTAGE': ['V', 'mdi:flash'],