mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
use enums in skybeacon (#62052)
This commit is contained in:
parent
25f72e45d7
commit
ed8c7afc52
@ -8,11 +8,14 @@ from pygatt.backends import Characteristic, GATTToolBackend
|
|||||||
from pygatt.exceptions import BLEError, NotConnectedError, NotificationTimeout
|
from pygatt.exceptions import BLEError, NotConnectedError, NotificationTimeout
|
||||||
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_MAC,
|
CONF_MAC,
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
EVENT_HOMEASSISTANT_STOP,
|
EVENT_HOMEASSISTANT_STOP,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
STATE_UNKNOWN,
|
STATE_UNKNOWN,
|
||||||
@ -91,7 +94,7 @@ class SkybeaconHumid(SensorEntity):
|
|||||||
class SkybeaconTemp(SensorEntity):
|
class SkybeaconTemp(SensorEntity):
|
||||||
"""Representation of a Skybeacon temperature sensor."""
|
"""Representation of a Skybeacon 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, name, mon):
|
def __init__(self, name, mon):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user