Add and use UNIT_DEGREE constant (#33978)

* Add and use UNIT_DEGREE constant

* Replace more occurrences

* Add and use TEMP_KELVIN

* Run isort
This commit is contained in:
springstan 2020-04-11 16:54:11 +02:00 committed by GitHub
parent c18a6d5ea3
commit b893150154
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 67 additions and 47 deletions

View file

@ -9,6 +9,7 @@ from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
DEVICE_CLASS_POWER,
ENERGY_KILO_WATT_HOUR,
UNIT_DEGREE,
)
from homeassistant.setup import async_setup_component
@ -47,7 +48,7 @@ async def prometheus_client(loop, hass, hass_client):
sensor3.entity_id = "sensor.electricity_price"
await sensor3.async_update_ha_state()
sensor4 = DemoSensor(None, "Wind Direction", 25, None, "°", None)
sensor4 = DemoSensor(None, "Wind Direction", 25, None, UNIT_DEGREE, None)
sensor4.hass = hass
sensor4.entity_id = "sensor.wind_direction"
await sensor4.async_update_ha_state()