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

@ -4,7 +4,7 @@ import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (CONF_NAME, CONF_ID)
from homeassistant.const import (CONF_NAME, CONF_ID, POWER_WATT)
from homeassistant.helpers.entity import Entity
import homeassistant.helpers.config_validation as cv
from homeassistant.components import enocean
@ -59,4 +59,4 @@ class EnOceanSensor(enocean.EnOceanDevice, Entity):
@property
def unit_of_measurement(self):
"""Return the unit of measurement."""
return 'W'
return POWER_WATT