1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-24 04:33:49 +01:00

Optionally show internal components on the web server (#2627)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
This commit is contained in:
mechanarchy
2021-11-30 02:52:20 +11:00
committed by GitHub
parent adf48246a9
commit 6f07421911
7 changed files with 67 additions and 78 deletions

View File

@@ -58,6 +58,12 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
*/
void set_js_include(const char *js_include);
/** Determine whether internal components should be displayed on the web server.
* Defaults to false.
*
* @param include_internal Whether internal components should be displayed.
*/
void set_include_internal(bool include_internal) { include_internal_ = include_internal; }
/** Set whether or not the webserver should expose the OTA form and handler.
*
* @param allow_ota.
@@ -188,6 +194,7 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
const char *css_include_{nullptr};
const char *js_url_{nullptr};
const char *js_include_{nullptr};
bool include_internal_{false};
bool allow_ota_{true};
};