mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 07:47:08 +00:00
Use new enums in temper (#62428)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
418221bd21
commit
314dce914f
@ -4,11 +4,14 @@ import logging
|
|||||||
from temperusb.temper import TemperHandler
|
from temperusb.temper import TemperHandler
|
||||||
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 (
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
CONF_OFFSET,
|
CONF_OFFSET,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
DEVICE_DEFAULT_NAME,
|
DEVICE_DEFAULT_NAME,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
)
|
)
|
||||||
@ -60,7 +63,7 @@ def reset_devices():
|
|||||||
class TemperSensor(SensorEntity):
|
class TemperSensor(SensorEntity):
|
||||||
"""Representation of a Temper temperature sensor."""
|
"""Representation of a Temper temperature sensor."""
|
||||||
|
|
||||||
_attr_device_class = DEVICE_CLASS_TEMPERATURE
|
_attr_device_class = SensorDeviceClass.TEMPERATURE
|
||||||
_attr_native_unit_of_measurement = TEMP_CELSIUS
|
_attr_native_unit_of_measurement = TEMP_CELSIUS
|
||||||
|
|
||||||
def __init__(self, temper_device, name, scaling):
|
def __init__(self, temper_device, name, scaling):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user