Use ENERGY_KILO_WATT_HOUR constant (#33962)

This commit is contained in:
springstan 2020-04-10 20:21:29 +02:00 committed by GitHub
parent c3c4752fa5
commit 02c9e47db8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 132 additions and 60 deletions

View file

@ -10,6 +10,7 @@ from homeassistant.const import (
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_TOKEN,
ENERGY_KILO_WATT_HOUR,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@ -25,7 +26,7 @@ MSG_LOCATION = (
"For the coordinates, "
"you need to use both latitude and longitude."
)
CO2_INTENSITY_UNIT = "CO2eq/kWh"
CO2_INTENSITY_UNIT = f"CO2eq/{ENERGY_KILO_WATT_HOUR}"
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{
vol.Required(CONF_TOKEN): cv.string,