mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Compile statistics for battery, humidity and pressure sensors (#50920)
This commit is contained in:
parent
c979101a02
commit
6f26687aa7
@ -8,7 +8,10 @@ from statistics import fmean
|
|||||||
from homeassistant.components.recorder import history, statistics
|
from homeassistant.components.recorder import history, statistics
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
ATTR_STATE_CLASS,
|
ATTR_STATE_CLASS,
|
||||||
|
DEVICE_CLASS_BATTERY,
|
||||||
DEVICE_CLASS_ENERGY,
|
DEVICE_CLASS_ENERGY,
|
||||||
|
DEVICE_CLASS_HUMIDITY,
|
||||||
|
DEVICE_CLASS_PRESSURE,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
DEVICE_CLASS_TEMPERATURE,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
)
|
)
|
||||||
@ -19,8 +22,11 @@ import homeassistant.util.dt as dt_util
|
|||||||
from . import DOMAIN
|
from . import DOMAIN
|
||||||
|
|
||||||
DEVICE_CLASS_STATISTICS = {
|
DEVICE_CLASS_STATISTICS = {
|
||||||
DEVICE_CLASS_TEMPERATURE: {"mean", "min", "max"},
|
DEVICE_CLASS_BATTERY: {"mean", "min", "max"},
|
||||||
DEVICE_CLASS_ENERGY: {"sum"},
|
DEVICE_CLASS_ENERGY: {"sum"},
|
||||||
|
DEVICE_CLASS_HUMIDITY: {"mean", "min", "max"},
|
||||||
|
DEVICE_CLASS_PRESSURE: {"mean", "min", "max"},
|
||||||
|
DEVICE_CLASS_TEMPERATURE: {"mean", "min", "max"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user