Meteofrance - Add state_class to appropriate sensors ()

Co-authored-by: Erik Montnemery <erik@montnemery.com>
pull/58418/head
David Le Brun 2021-10-25 15:55:49 +02:00 committed by GitHub
parent 42793927f7
commit ffd7c998d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions
homeassistant/components/meteo_france

View File

@ -3,7 +3,10 @@ from __future__ import annotations
from dataclasses import dataclass
from homeassistant.components.sensor import SensorEntityDescription
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
SensorEntityDescription,
)
from homeassistant.components.weather import (
ATTR_CONDITION_CLEAR_NIGHT,
ATTR_CONDITION_CLOUDY,
@ -72,6 +75,7 @@ SENSOR_TYPES: tuple[MeteoFranceSensorEntityDescription, ...] = (
name="Pressure",
native_unit_of_measurement=PRESSURE_HPA,
device_class=DEVICE_CLASS_PRESSURE,
state_class=STATE_CLASS_MEASUREMENT,
entity_registry_enabled_default=False,
data_path="current_forecast:sea_level",
),
@ -79,6 +83,7 @@ SENSOR_TYPES: tuple[MeteoFranceSensorEntityDescription, ...] = (
key="wind_gust",
name="Wind gust",
native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR,
state_class=STATE_CLASS_MEASUREMENT,
icon="mdi:weather-windy-variant",
entity_registry_enabled_default=False,
data_path="current_forecast:wind:gust",
@ -87,6 +92,7 @@ SENSOR_TYPES: tuple[MeteoFranceSensorEntityDescription, ...] = (
key="wind_speed",
name="Wind speed",
native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR,
state_class=STATE_CLASS_MEASUREMENT,
icon="mdi:weather-windy",
entity_registry_enabled_default=False,
data_path="current_forecast:wind:speed",
@ -96,6 +102,7 @@ SENSOR_TYPES: tuple[MeteoFranceSensorEntityDescription, ...] = (
name="Temperature",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
entity_registry_enabled_default=False,
data_path="current_forecast:T:value",
),