mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Use SensorDeviceClass in thermoworks_smoke (#62637)
This commit is contained in:
parent
772428e70f
commit
dff9767da5
@ -11,14 +11,17 @@ from stringcase import camelcase, snakecase
|
|||||||
import thermoworks_smoke
|
import thermoworks_smoke
|
||||||
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_BATTERY_LEVEL,
|
ATTR_BATTERY_LEVEL,
|
||||||
CONF_EMAIL,
|
CONF_EMAIL,
|
||||||
CONF_EXCLUDE,
|
CONF_EXCLUDE,
|
||||||
CONF_MONITORED_CONDITIONS,
|
CONF_MONITORED_CONDITIONS,
|
||||||
CONF_PASSWORD,
|
CONF_PASSWORD,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
TEMP_FAHRENHEIT,
|
TEMP_FAHRENHEIT,
|
||||||
)
|
)
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
@ -106,7 +109,7 @@ class ThermoworksSmokeSensor(SensorEntity):
|
|||||||
self._unique_id = f"{serial}-{sensor_type}"
|
self._unique_id = f"{serial}-{sensor_type}"
|
||||||
self.serial = serial
|
self.serial = serial
|
||||||
self.mgr = mgr
|
self.mgr = mgr
|
||||||
self._attr_device_class = DEVICE_CLASS_TEMPERATURE
|
self._attr_device_class = SensorDeviceClass.TEMPERATURE
|
||||||
self.update_unit()
|
self.update_unit()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user