Use new enums in meteo-france (#61896)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/61916/head
epenet 2021-12-15 16:36:22 +01:00 committed by GitHub
parent e095cd95bf
commit 3ac585ea2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 11 deletions

View File

@ -4,8 +4,9 @@ from __future__ import annotations
from dataclasses import dataclass
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
SensorDeviceClass,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.components.weather import (
ATTR_CONDITION_CLEAR_NIGHT,
@ -25,9 +26,6 @@ from homeassistant.components.weather import (
ATTR_CONDITION_WINDY_VARIANT,
)
from homeassistant.const import (
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_TIMESTAMP,
LENGTH_MILLIMETERS,
PERCENTAGE,
PRESSURE_HPA,
@ -75,8 +73,8 @@ SENSOR_TYPES: tuple[MeteoFranceSensorEntityDescription, ...] = (
key="pressure",
name="Pressure",
native_unit_of_measurement=PRESSURE_HPA,
device_class=DEVICE_CLASS_PRESSURE,
state_class=STATE_CLASS_MEASUREMENT,
device_class=SensorDeviceClass.PRESSURE,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
data_path="current_forecast:sea_level",
),
@ -84,7 +82,7 @@ SENSOR_TYPES: tuple[MeteoFranceSensorEntityDescription, ...] = (
key="wind_gust",
name="Wind gust",
native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR,
state_class=STATE_CLASS_MEASUREMENT,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:weather-windy-variant",
entity_registry_enabled_default=False,
data_path="current_forecast:wind:gust",
@ -93,7 +91,7 @@ SENSOR_TYPES: tuple[MeteoFranceSensorEntityDescription, ...] = (
key="wind_speed",
name="Wind speed",
native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR,
state_class=STATE_CLASS_MEASUREMENT,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:weather-windy",
entity_registry_enabled_default=False,
data_path="current_forecast:wind:speed",
@ -102,8 +100,8 @@ SENSOR_TYPES: tuple[MeteoFranceSensorEntityDescription, ...] = (
key="temperature",
name="Temperature",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
data_path="current_forecast:T:value",
),
@ -146,7 +144,7 @@ SENSOR_TYPES_RAIN: tuple[MeteoFranceSensorEntityDescription, ...] = (
MeteoFranceSensorEntityDescription(
key="next_rain",
name="Next rain",
device_class=DEVICE_CLASS_TIMESTAMP,
device_class=SensorDeviceClass.TIMESTAMP,
data_path="",
),
)