mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Use SensorDeviceClass in environment_canada (#61390)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
f12261b575
commit
8c39eade5e
@ -4,12 +4,15 @@ import re
|
|||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
from homeassistant.components.sensor import (
|
||||||
|
PLATFORM_SCHEMA,
|
||||||
|
SensorDeviceClass,
|
||||||
|
SensorEntity,
|
||||||
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_LOCATION,
|
ATTR_LOCATION,
|
||||||
CONF_LATITUDE,
|
CONF_LATITUDE,
|
||||||
CONF_LONGITUDE,
|
CONF_LONGITUDE,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
)
|
)
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
@ -135,7 +138,7 @@ class ECSensor(CoordinatorEntity, SensorEntity):
|
|||||||
"humidex",
|
"humidex",
|
||||||
):
|
):
|
||||||
self._unit = TEMP_CELSIUS
|
self._unit = TEMP_CELSIUS
|
||||||
self._device_class = DEVICE_CLASS_TEMPERATURE
|
self._device_class = SensorDeviceClass.TEMPERATURE
|
||||||
else:
|
else:
|
||||||
self._unit = sensor_data.get("unit")
|
self._unit = sensor_data.get("unit")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user