use enums in skybeacon (#62052)

This commit is contained in:
Robert Hillis 2021-12-16 08:20:00 -05:00 committed by GitHub
parent 25f72e45d7
commit ed8c7afc52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,11 +8,14 @@ from pygatt.backends import Characteristic, GATTToolBackend
from pygatt.exceptions import BLEError, NotConnectedError, NotificationTimeout
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 (
CONF_MAC,
CONF_NAME,
DEVICE_CLASS_TEMPERATURE,
EVENT_HOMEASSISTANT_STOP,
PERCENTAGE,
STATE_UNKNOWN,
@ -91,7 +94,7 @@ class SkybeaconHumid(SensorEntity):
class SkybeaconTemp(SensorEntity):
"""Representation of a Skybeacon temperature sensor."""
_attr_device_class = DEVICE_CLASS_TEMPERATURE
_attr_device_class = SensorDeviceClass.TEMPERATURE
_attr_native_unit_of_measurement = TEMP_CELSIUS
def __init__(self, name, mon):