Use enums in waqi (#61998)
This commit is contained in:
parent
7764772202
commit
9d66dd35cc
1 changed files with 7 additions and 4 deletions
|
@ -7,13 +7,16 @@ import aiohttp
|
|||
import voluptuous as vol
|
||||
from waqiasync import WaqiClient
|
||||
|
||||
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity
|
||||
from homeassistant.components.sensor import (
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_ATTRIBUTION,
|
||||
ATTR_TEMPERATURE,
|
||||
ATTR_TIME,
|
||||
CONF_TOKEN,
|
||||
DEVICE_CLASS_AQI,
|
||||
)
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
@ -102,8 +105,8 @@ class WaqiSensor(SensorEntity):
|
|||
|
||||
_attr_icon = ATTR_ICON
|
||||
_attr_native_unit_of_measurement = ATTR_UNIT
|
||||
_attr_device_class = DEVICE_CLASS_AQI
|
||||
_attr_state_class = STATE_CLASS_MEASUREMENT
|
||||
_attr_device_class = SensorDeviceClass.AQI
|
||||
_attr_state_class = SensorStateClass.MEASUREMENT
|
||||
|
||||
def __init__(self, client, station):
|
||||
"""Initialize the sensor."""
|
||||
|
|
Loading…
Add table
Reference in a new issue