[web_server] Minor python formatting

This commit is contained in:
Jesse Hills 2024-05-14 13:41:45 +12:00
parent 921e56f2c6
commit 31e77e13ab
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A
1 changed files with 6 additions and 6 deletions

View File

@ -35,19 +35,19 @@ WebServer = web_server_ns.class_("WebServer", cg.Component, cg.Controller)
def default_url(config):
config = config.copy()
if config[CONF_VERSION] == 1:
if not (CONF_CSS_URL in config):
if CONF_CSS_URL not in config:
config[CONF_CSS_URL] = "https://esphome.io/_static/webserver-v1.min.css"
if not (CONF_JS_URL in config):
if CONF_JS_URL not in config:
config[CONF_JS_URL] = "https://esphome.io/_static/webserver-v1.min.js"
if config[CONF_VERSION] == 2:
if not (CONF_CSS_URL in config):
if CONF_CSS_URL not in config:
config[CONF_CSS_URL] = ""
if not (CONF_JS_URL in config):
if CONF_JS_URL not in config:
config[CONF_JS_URL] = "https://oi.esphome.io/v2/www.js"
if config[CONF_VERSION] == 3:
if not (CONF_CSS_URL in config):
if CONF_CSS_URL not in config:
config[CONF_CSS_URL] = ""
if not (CONF_JS_URL in config):
if CONF_JS_URL not in config:
config[CONF_JS_URL] = "https://oi.esphome.io/v3/www.js"
return config