mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Use enums in xbee (#61982)
This commit is contained in:
parent
b8dabfe659
commit
a41810efcf
@ -5,8 +5,8 @@ import logging
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from xbee_helper.exceptions import ZigBeeException, ZigBeeTxFailure
|
from xbee_helper.exceptions import ZigBeeException, ZigBeeTxFailure
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity
|
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||||
from homeassistant.const import CONF_TYPE, DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS
|
from homeassistant.const import CONF_TYPE, TEMP_CELSIUS
|
||||||
|
|
||||||
from . import DOMAIN, PLATFORM_SCHEMA, XBeeAnalogIn, XBeeAnalogInConfig, XBeeConfig
|
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):
|
class XBeeTemperatureSensor(SensorEntity):
|
||||||
"""Representation of XBee Pro temperature sensor."""
|
"""Representation of XBee Pro 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, config, device):
|
def __init__(self, config, device):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user