[web_server] Conditionally compile authentication code to save flash memory (#10022)

This commit is contained in:
J. Nick Koston
2025-08-04 14:09:12 +12:00
committed by GitHub
parent a75f73dbf0
commit 494a1a216c
7 changed files with 21 additions and 0 deletions
@@ -298,6 +298,7 @@ async def to_code(config):
if config[CONF_ENABLE_PRIVATE_NETWORK_ACCESS]:
cg.add_define("USE_WEBSERVER_PRIVATE_NETWORK_ACCESS")
if CONF_AUTH in config:
cg.add_define("USE_WEBSERVER_AUTH")
cg.add(paren.set_auth_username(config[CONF_AUTH][CONF_USERNAME]))
cg.add(paren.set_auth_password(config[CONF_AUTH][CONF_PASSWORD]))
if CONF_CSS_INCLUDE in config: