Use new enums in nest (#61942)
This commit is contained in:
parent
1e9e056671
commit
25d33a2126
3 changed files with 18 additions and 24 deletions
|
@ -1,12 +1,10 @@
|
|||
"""Support for Nest Thermostat sensors for the legacy API."""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||
from homeassistant.const import (
|
||||
CONF_MONITORED_CONDITIONS,
|
||||
CONF_SENSORS,
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
PERCENTAGE,
|
||||
STATE_OFF,
|
||||
TEMP_CELSIUS,
|
||||
|
@ -47,7 +45,7 @@ _VALID_SENSOR_TYPES = (
|
|||
|
||||
SENSOR_UNITS = {"humidity": PERCENTAGE}
|
||||
|
||||
SENSOR_DEVICE_CLASSES = {"humidity": DEVICE_CLASS_HUMIDITY}
|
||||
SENSOR_DEVICE_CLASSES = {"humidity": SensorDeviceClass.HUMIDITY}
|
||||
|
||||
VARIABLE_NAME_MAPPING = {"eta": "eta_begin", "operation_mode": "mode"}
|
||||
|
||||
|
@ -201,7 +199,7 @@ class NestTempSensor(NestSensorDevice, SensorEntity):
|
|||
@property
|
||||
def device_class(self):
|
||||
"""Return the device class of the sensor."""
|
||||
return DEVICE_CLASS_TEMPERATURE
|
||||
return SensorDeviceClass.TEMPERATURE
|
||||
|
||||
def update(self):
|
||||
"""Retrieve latest state."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue