Add long term statistics to buienradar (#58917)

This commit is contained in:
Ted van den Brink 2022-01-07 14:36:43 +01:00 committed by GitHub
parent 8b216db885
commit b3f3e7259e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ from homeassistant.components.sensor import (
SensorDeviceClass, SensorDeviceClass,
SensorEntity, SensorEntity,
SensorEntityDescription, SensorEntityDescription,
SensorStateClass,
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( from homeassistant.const import (
@ -117,24 +118,28 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
name="Humidity", name="Humidity",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
icon="mdi:water-percent", icon="mdi:water-percent",
state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key="temperature", key="temperature",
name="Temperature", name="Temperature",
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key="groundtemperature", key="groundtemperature",
name="Ground temperature", name="Ground temperature",
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key="windspeed", key="windspeed",
name="Wind speed", name="Wind speed",
native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR,
icon="mdi:weather-windy", icon="mdi:weather-windy",
state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key="windforce", key="windforce",
@ -158,11 +163,13 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
name="Pressure", name="Pressure",
native_unit_of_measurement=PRESSURE_HPA, native_unit_of_measurement=PRESSURE_HPA,
icon="mdi:gauge", icon="mdi:gauge",
state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key="visibility", key="visibility",
name="Visibility", name="Visibility",
native_unit_of_measurement=LENGTH_KILOMETERS, native_unit_of_measurement=LENGTH_KILOMETERS,
state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key="windgust", key="windgust",
@ -175,12 +182,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
name="Precipitation", name="Precipitation",
native_unit_of_measurement=PRECIPITATION_MILLIMETERS_PER_HOUR, native_unit_of_measurement=PRECIPITATION_MILLIMETERS_PER_HOUR,
icon="mdi:weather-pouring", icon="mdi:weather-pouring",
state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key="irradiance", key="irradiance",
name="Irradiance", name="Irradiance",
native_unit_of_measurement=IRRADIATION_WATTS_PER_SQUARE_METER, native_unit_of_measurement=IRRADIATION_WATTS_PER_SQUARE_METER,
icon="mdi:sunglasses", icon="mdi:sunglasses",
state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key="precipitation_forecast_average", key="precipitation_forecast_average",