mirror of
https://github.com/esphome/esphome.git
synced 2026-09-18 10:38:38 +00:00
[web_server] Include assumed_state in cover detail=all JSON
cover_json_() did not serialize the assumed_state flag in the DETAIL_ALL JSON, unlike switch_json_() which already emits it. Consumers of the web server JSON/SSE API could not tell whether a cover's state is assumed, causing a web vs native-API inconsistency (the native API exposes the flag, so Home Assistant behaves correctly, but the web UI does not). Emit assumed_state from the cover's traits, matching the switch.
This commit is contained in:
@@ -1079,6 +1079,7 @@ json::SerializationBuffer<> WebServer::cover_json_(cover::Cover *obj, JsonDetail
|
||||
if (obj->get_traits().get_supports_tilt())
|
||||
root[ESPHOME_F("tilt")] = obj->tilt;
|
||||
if (start_config == DETAIL_ALL) {
|
||||
root[ESPHOME_F("assumed_state")] = obj->get_traits().get_is_assumed_state();
|
||||
this->add_sorting_info_(root, obj);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user