From 481f06762521de4136562aad0ea4ba38e26b76e2 Mon Sep 17 00:00:00 2001 From: Daniel Baulig Date: Wed, 21 Feb 2024 17:33:28 -0800 Subject: [PATCH] web_server: Add a position property for cover entities that have the supports position trait (#6269) --- esphome/components/web_server/web_server.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/web_server/web_server.cpp b/esphome/components/web_server/web_server.cpp index 54e9e6ebcc..f87e920f13 100644 --- a/esphome/components/web_server/web_server.cpp +++ b/esphome/components/web_server/web_server.cpp @@ -785,6 +785,8 @@ std::string WebServer::cover_json(cover::Cover *obj, JsonDetail start_config) { obj->position, start_config); root["current_operation"] = cover::cover_operation_to_str(obj->current_operation); + if (obj->get_traits().get_supports_position()) + root["position"] = obj->position; if (obj->get_traits().get_supports_tilt()) root["tilt"] = obj->tilt; });