1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

Add support for Sensor state class (#1835)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Franck Nijhof
2021-06-03 03:49:56 +02:00
committed by GitHub
parent 913ac8b7e8
commit 11fb54c74e
112 changed files with 1237 additions and 269 deletions

View File

@@ -7,8 +7,9 @@ from esphome.const import (
CONF_LAMBDA,
CONF_STATE,
DEVICE_CLASS_EMPTY,
UNIT_EMPTY,
ICON_EMPTY,
STATE_CLASS_NONE,
UNIT_EMPTY,
)
from .. import template_ns
@@ -17,7 +18,13 @@ TemplateSensor = template_ns.class_(
)
CONFIG_SCHEMA = (
sensor.sensor_schema(UNIT_EMPTY, ICON_EMPTY, 1, DEVICE_CLASS_EMPTY)
sensor.sensor_schema(
UNIT_EMPTY,
ICON_EMPTY,
1,
DEVICE_CLASS_EMPTY,
STATE_CLASS_NONE,
)
.extend(
{
cv.GenerateID(): cv.declare_id(TemplateSensor),