mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Use new SensorDeviceClass enums in aemet (#61256)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
048bdd321e
commit
fd58c1eff5
@ -1,7 +1,11 @@
|
|||||||
"""Constant values for the AEMET OpenData component."""
|
"""Constant values for the AEMET OpenData component."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntityDescription, SensorStateClass
|
from homeassistant.components.sensor import (
|
||||||
|
SensorDeviceClass,
|
||||||
|
SensorEntityDescription,
|
||||||
|
SensorStateClass,
|
||||||
|
)
|
||||||
from homeassistant.components.weather import (
|
from homeassistant.components.weather import (
|
||||||
ATTR_CONDITION_CLEAR_NIGHT,
|
ATTR_CONDITION_CLEAR_NIGHT,
|
||||||
ATTR_CONDITION_CLOUDY,
|
ATTR_CONDITION_CLOUDY,
|
||||||
@ -24,10 +28,6 @@ from homeassistant.components.weather import (
|
|||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
DEGREE,
|
DEGREE,
|
||||||
DEVICE_CLASS_HUMIDITY,
|
|
||||||
DEVICE_CLASS_PRESSURE,
|
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
DEVICE_CLASS_TIMESTAMP,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRECIPITATION_MILLIMETERS_PER_HOUR,
|
PRECIPITATION_MILLIMETERS_PER_HOUR,
|
||||||
PRESSURE_HPA,
|
PRESSURE_HPA,
|
||||||
@ -219,18 +219,18 @@ FORECAST_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
key=ATTR_FORECAST_TEMP,
|
key=ATTR_FORECAST_TEMP,
|
||||||
name="Temperature",
|
name="Temperature",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_FORECAST_TEMP_LOW,
|
key=ATTR_FORECAST_TEMP_LOW,
|
||||||
name="Temperature Low",
|
name="Temperature Low",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_FORECAST_TIME,
|
key=ATTR_FORECAST_TIME,
|
||||||
name="Time",
|
name="Time",
|
||||||
device_class=DEVICE_CLASS_TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_FORECAST_WIND_BEARING,
|
key=ATTR_FORECAST_WIND_BEARING,
|
||||||
@ -252,14 +252,14 @@ WEATHER_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
key=ATTR_API_HUMIDITY,
|
key=ATTR_API_HUMIDITY,
|
||||||
name="Humidity",
|
name="Humidity",
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=SensorDeviceClass.HUMIDITY,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_API_PRESSURE,
|
key=ATTR_API_PRESSURE,
|
||||||
name="Pressure",
|
name="Pressure",
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=PRESSURE_HPA,
|
||||||
device_class=DEVICE_CLASS_PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
@ -295,7 +295,7 @@ WEATHER_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_API_STATION_TIMESTAMP,
|
key=ATTR_API_STATION_TIMESTAMP,
|
||||||
name="Station timestamp",
|
name="Station timestamp",
|
||||||
device_class=DEVICE_CLASS_TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_API_STORM_PROB,
|
key=ATTR_API_STORM_PROB,
|
||||||
@ -307,14 +307,14 @@ WEATHER_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
key=ATTR_API_TEMPERATURE,
|
key=ATTR_API_TEMPERATURE,
|
||||||
name="Temperature",
|
name="Temperature",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_API_TEMPERATURE_FEELING,
|
key=ATTR_API_TEMPERATURE_FEELING,
|
||||||
name="Temperature feeling",
|
name="Temperature feeling",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
@ -328,7 +328,7 @@ WEATHER_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_API_TOWN_TIMESTAMP,
|
key=ATTR_API_TOWN_TIMESTAMP,
|
||||||
name="Town timestamp",
|
name="Town timestamp",
|
||||||
device_class=DEVICE_CLASS_TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_API_WIND_BEARING,
|
key=ATTR_API_WIND_BEARING,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user