Use enums in xbee (#61982)

pull/62011/head
Robert Hillis 2021-12-16 03:04:11 -05:00 committed by GitHub
parent b8dabfe659
commit a41810efcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -5,8 +5,8 @@ import logging
import voluptuous as vol
from xbee_helper.exceptions import ZigBeeException, ZigBeeTxFailure
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import CONF_TYPE, DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.const import CONF_TYPE, TEMP_CELSIUS
from . import DOMAIN, PLATFORM_SCHEMA, XBeeAnalogIn, XBeeAnalogInConfig, XBeeConfig
@ -46,7 +46,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
class XBeeTemperatureSensor(SensorEntity):
"""Representation of XBee Pro temperature sensor."""
_attr_device_class = DEVICE_CLASS_TEMPERATURE
_attr_device_class = SensorDeviceClass.TEMPERATURE
_attr_native_unit_of_measurement = TEMP_CELSIUS
def __init__(self, config, device):