From 1000c4466fd10ff64bbb373a109c80ad2b65db59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=2E=20=C3=81rkosi=20R=C3=B3bert?= Date: Tue, 25 Oct 2022 08:10:03 +0200 Subject: [PATCH] add proper device class to uptime (#3928) Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/components/uptime/sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/uptime/sensor.py b/esphome/components/uptime/sensor.py index 103bc3a666..07d7d8f2cf 100644 --- a/esphome/components/uptime/sensor.py +++ b/esphome/components/uptime/sensor.py @@ -6,6 +6,7 @@ from esphome.const import ( STATE_CLASS_TOTAL_INCREASING, UNIT_SECOND, ICON_TIMER, + DEVICE_CLASS_DURATION, ) uptime_ns = cg.esphome_ns.namespace("uptime") @@ -17,6 +18,7 @@ CONFIG_SCHEMA = sensor.sensor_schema( icon=ICON_TIMER, accuracy_decimals=0, state_class=STATE_CLASS_TOTAL_INCREASING, + device_class=DEVICE_CLASS_DURATION, entity_category=ENTITY_CATEGORY_DIAGNOSTIC, ).extend(cv.polling_component_schema("60s"))