mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 13:34:54 +01:00
Set pulse meter total to use state class measurement and last reset type auto (#2097)
This commit is contained in:
parent
5983ccc55c
commit
2966a62429
1 changed files with 7 additions and 2 deletions
|
@ -11,8 +11,8 @@ from esphome.const import (
|
||||||
CONF_TOTAL,
|
CONF_TOTAL,
|
||||||
CONF_VALUE,
|
CONF_VALUE,
|
||||||
ICON_PULSE,
|
ICON_PULSE,
|
||||||
|
LAST_RESET_TYPE_AUTO,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
STATE_CLASS_NONE,
|
|
||||||
UNIT_PULSES,
|
UNIT_PULSES,
|
||||||
UNIT_PULSES_PER_MINUTE,
|
UNIT_PULSES_PER_MINUTE,
|
||||||
DEVICE_CLASS_EMPTY,
|
DEVICE_CLASS_EMPTY,
|
||||||
|
@ -59,7 +59,12 @@ CONFIG_SCHEMA = sensor.sensor_schema(
|
||||||
cv.Optional(CONF_INTERNAL_FILTER, default="13us"): validate_internal_filter,
|
cv.Optional(CONF_INTERNAL_FILTER, default="13us"): validate_internal_filter,
|
||||||
cv.Optional(CONF_TIMEOUT, default="5min"): validate_timeout,
|
cv.Optional(CONF_TIMEOUT, default="5min"): validate_timeout,
|
||||||
cv.Optional(CONF_TOTAL): sensor.sensor_schema(
|
cv.Optional(CONF_TOTAL): sensor.sensor_schema(
|
||||||
UNIT_PULSES, ICON_PULSE, 0, DEVICE_CLASS_EMPTY, STATE_CLASS_NONE
|
UNIT_PULSES,
|
||||||
|
ICON_PULSE,
|
||||||
|
0,
|
||||||
|
DEVICE_CLASS_EMPTY,
|
||||||
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
LAST_RESET_TYPE_AUTO,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue