From 0c7a3d1fffef6c9292b965bb0b9f8dc6790522e5 Mon Sep 17 00:00:00 2001
From: DAVe3283 <DAVe3283@gmail.com>
Date: Mon, 13 Mar 2023 18:52:19 -0600
Subject: [PATCH] Revert "Remove state class from uptime sensor (#4345)"
 (#4557)

This reverts commit 36c2e770bfd5b43a5471590be0d10033049eb3ea.
Addresses esphome/issues#4193.
---
 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 50e584f5d5..07d7d8f2cf 100644
--- a/esphome/components/uptime/sensor.py
+++ b/esphome/components/uptime/sensor.py
@@ -3,6 +3,7 @@ import esphome.config_validation as cv
 from esphome.components import sensor
 from esphome.const import (
     ENTITY_CATEGORY_DIAGNOSTIC,
+    STATE_CLASS_TOTAL_INCREASING,
     UNIT_SECOND,
     ICON_TIMER,
     DEVICE_CLASS_DURATION,
@@ -16,6 +17,7 @@ CONFIG_SCHEMA = sensor.sensor_schema(
     unit_of_measurement=UNIT_SECOND,
     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"))