mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 08:55:22 +01:00
web_server: Add a position property for cover entities that have the supports position trait (#6269)
This commit is contained in:
parent
a3fa1e6c52
commit
481f067625
1 changed files with 2 additions and 0 deletions
|
@ -785,6 +785,8 @@ std::string WebServer::cover_json(cover::Cover *obj, JsonDetail start_config) {
|
||||||
obj->position, start_config);
|
obj->position, start_config);
|
||||||
root["current_operation"] = cover::cover_operation_to_str(obj->current_operation);
|
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())
|
if (obj->get_traits().get_supports_tilt())
|
||||||
root["tilt"] = obj->tilt;
|
root["tilt"] = obj->tilt;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue