Centrally define Watt (#21570)

* centralize Watt definition

* lint
This commit is contained in:
Diogo Gomes
2019-03-02 10:29:59 +00:00
committed by Daniel Høyer Iversen
parent e55ce61100
commit ed2b9e5483
26 changed files with 70 additions and 58 deletions

View File

@@ -7,7 +7,7 @@ at https://home-assistant.io/components/sensor.zha/
import logging
from homeassistant.components.sensor import DOMAIN
from homeassistant.const import TEMP_CELSIUS
from homeassistant.const import TEMP_CELSIUS, POWER_WATT
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .core.const import (
DATA_ZHA, DATA_ZHA_DISPATCHERS, ZHA_DISCOVERY_NEW, HUMIDITY, TEMPERATURE,
@@ -69,8 +69,8 @@ UNIT_REGISTRY = {
TEMPERATURE: TEMP_CELSIUS,
PRESSURE: 'hPa',
ILLUMINANCE: 'lx',
METERING: 'W',
ELECTRICAL_MEASUREMENT: 'W',
METERING: POWER_WATT,
ELECTRICAL_MEASUREMENT: POWER_WATT,
GENERIC: None
}