mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Add long term statistics for tellduslive (#75789)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
23ef3bf9ac
commit
2f652901b6
@ -6,6 +6,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 (
|
||||||
@ -43,24 +44,28 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
|
|||||||
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,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_HUMIDITY: SensorEntityDescription(
|
SENSOR_TYPE_HUMIDITY: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_HUMIDITY,
|
key=SENSOR_TYPE_HUMIDITY,
|
||||||
name="Humidity",
|
name="Humidity",
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
device_class=SensorDeviceClass.HUMIDITY,
|
device_class=SensorDeviceClass.HUMIDITY,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_RAINRATE: SensorEntityDescription(
|
SENSOR_TYPE_RAINRATE: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_RAINRATE,
|
key=SENSOR_TYPE_RAINRATE,
|
||||||
name="Rain rate",
|
name="Rain rate",
|
||||||
native_unit_of_measurement=PRECIPITATION_MILLIMETERS_PER_HOUR,
|
native_unit_of_measurement=PRECIPITATION_MILLIMETERS_PER_HOUR,
|
||||||
icon="mdi:water",
|
icon="mdi:water",
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_RAINTOTAL: SensorEntityDescription(
|
SENSOR_TYPE_RAINTOTAL: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_RAINTOTAL,
|
key=SENSOR_TYPE_RAINTOTAL,
|
||||||
name="Rain total",
|
name="Rain total",
|
||||||
native_unit_of_measurement=LENGTH_MILLIMETERS,
|
native_unit_of_measurement=LENGTH_MILLIMETERS,
|
||||||
icon="mdi:water",
|
icon="mdi:water",
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_WINDDIRECTION: SensorEntityDescription(
|
SENSOR_TYPE_WINDDIRECTION: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_WINDDIRECTION,
|
key=SENSOR_TYPE_WINDDIRECTION,
|
||||||
@ -70,38 +75,45 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
|
|||||||
key=SENSOR_TYPE_WINDAVERAGE,
|
key=SENSOR_TYPE_WINDAVERAGE,
|
||||||
name="Wind average",
|
name="Wind average",
|
||||||
native_unit_of_measurement=SPEED_METERS_PER_SECOND,
|
native_unit_of_measurement=SPEED_METERS_PER_SECOND,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_WINDGUST: SensorEntityDescription(
|
SENSOR_TYPE_WINDGUST: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_WINDGUST,
|
key=SENSOR_TYPE_WINDGUST,
|
||||||
name="Wind gust",
|
name="Wind gust",
|
||||||
native_unit_of_measurement=SPEED_METERS_PER_SECOND,
|
native_unit_of_measurement=SPEED_METERS_PER_SECOND,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_UV: SensorEntityDescription(
|
SENSOR_TYPE_UV: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_UV,
|
key=SENSOR_TYPE_UV,
|
||||||
name="UV",
|
name="UV",
|
||||||
native_unit_of_measurement=UV_INDEX,
|
native_unit_of_measurement=UV_INDEX,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_WATT: SensorEntityDescription(
|
SENSOR_TYPE_WATT: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_WATT,
|
key=SENSOR_TYPE_WATT,
|
||||||
name="Power",
|
name="Power",
|
||||||
native_unit_of_measurement=POWER_WATT,
|
native_unit_of_measurement=POWER_WATT,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_LUMINANCE: SensorEntityDescription(
|
SENSOR_TYPE_LUMINANCE: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_LUMINANCE,
|
key=SENSOR_TYPE_LUMINANCE,
|
||||||
name="Luminance",
|
name="Luminance",
|
||||||
native_unit_of_measurement=LIGHT_LUX,
|
native_unit_of_measurement=LIGHT_LUX,
|
||||||
device_class=SensorDeviceClass.ILLUMINANCE,
|
device_class=SensorDeviceClass.ILLUMINANCE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_DEW_POINT: SensorEntityDescription(
|
SENSOR_TYPE_DEW_POINT: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_DEW_POINT,
|
key=SENSOR_TYPE_DEW_POINT,
|
||||||
name="Dew Point",
|
name="Dew Point",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_BAROMETRIC_PRESSURE: SensorEntityDescription(
|
SENSOR_TYPE_BAROMETRIC_PRESSURE: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_BAROMETRIC_PRESSURE,
|
key=SENSOR_TYPE_BAROMETRIC_PRESSURE,
|
||||||
name="Barometric Pressure",
|
name="Barometric Pressure",
|
||||||
native_unit_of_measurement="kPa",
|
native_unit_of_measurement="kPa",
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user