move to sensor/const.py
parent
1d616e920d
commit
604d0d066b
|
@ -17,7 +17,8 @@ from homeassistant.components.binary_sensor import (
|
|||
DEVICE_CLASSES as BINARY_SENSOR_DEVICE_CLASSES,
|
||||
)
|
||||
from homeassistant.components.cover import DEVICE_CLASSES as COVER_DEVICE_CLASSES
|
||||
from homeassistant.components.sensor import CONF_STATE_CLASS, STATE_CLASSES_SCHEMA
|
||||
from homeassistant.components.sensor import STATE_CLASSES_SCHEMA
|
||||
from homeassistant.components.sensor.const import CONF_STATE_CLASS
|
||||
from homeassistant.const import (
|
||||
CONF_DEVICE_CLASS,
|
||||
CONF_ENTITY_ID,
|
||||
|
|
|
@ -6,11 +6,8 @@ from typing import Any
|
|||
from xknx import XKNX
|
||||
from xknx.devices import Sensor as XknxSensor
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
CONF_STATE_CLASS,
|
||||
DEVICE_CLASSES,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.components.sensor import DEVICE_CLASSES, SensorEntity
|
||||
from homeassistant.components.sensor.const import CONF_STATE_CLASS
|
||||
from homeassistant.const import CONF_NAME, CONF_TYPE
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
|
|
@ -9,11 +9,11 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components import sensor
|
||||
from homeassistant.components.sensor import (
|
||||
CONF_STATE_CLASS,
|
||||
DEVICE_CLASSES_SCHEMA,
|
||||
STATE_CLASSES_SCHEMA,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.components.sensor.const import CONF_STATE_CLASS
|
||||
from homeassistant.const import (
|
||||
CONF_DEVICE_CLASS,
|
||||
CONF_FORCE_UPDATE,
|
||||
|
|
|
@ -89,7 +89,6 @@ DEVICE_CLASSES: Final[list[str]] = [
|
|||
|
||||
DEVICE_CLASSES_SCHEMA: Final = vol.All(vol.Lower, vol.In(DEVICE_CLASSES))
|
||||
|
||||
CONF_STATE_CLASS: Final = "state_class"
|
||||
# The state represents a measurement in present time
|
||||
STATE_CLASS_MEASUREMENT: Final = "measurement"
|
||||
# The state represents a monotonically increasing total, e.g. an amount of consumed gas
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
"""Constants for sensor."""
|
||||
from typing import Final
|
||||
|
||||
CONF_STATE_CLASS: Final = "state_class"
|
|
@ -4,7 +4,6 @@ from __future__ import annotations
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
CONF_STATE_CLASS,
|
||||
DEVICE_CLASSES_SCHEMA,
|
||||
DOMAIN as SENSOR_DOMAIN,
|
||||
ENTITY_ID_FORMAT,
|
||||
|
@ -12,6 +11,7 @@ from homeassistant.components.sensor import (
|
|||
STATE_CLASSES_SCHEMA,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.components.sensor.const import CONF_STATE_CLASS
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID,
|
||||
CONF_DEVICE_CLASS,
|
||||
|
|
Loading…
Reference in New Issue