mirror of
https://github.com/esphome/esphome.git
synced 2025-11-06 10:01:51 +00:00
Compare commits
16 Commits
2022.11.0b
...
2022.11.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70f1c71a9f | ||
|
|
816df5ad47 | ||
|
|
7e88eea532 | ||
|
|
d1cdfd3b72 | ||
|
|
d6a03d48f5 | ||
|
|
d453b42b1a | ||
|
|
7c19b961e2 | ||
|
|
fd8b9fb028 | ||
|
|
bdf1813b3a | ||
|
|
45b6c93f5f | ||
|
|
6124531479 | ||
|
|
b8549d323c | ||
|
|
01adece673 | ||
|
|
0220934e4c | ||
|
|
ca09693efa | ||
|
|
e96d7483b3 |
@@ -94,7 +94,7 @@ RUN \
|
||||
apt-get update \
|
||||
# Use pinned versions so that we get updates with build caching
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
nginx-light=1.18.0-6.1+deb11u2 \
|
||||
nginx-light=1.18.0-6.1+deb11u3 \
|
||||
&& rm -rf \
|
||||
/tmp/* \
|
||||
/var/{cache,log}/* \
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
import esphome.final_validate as fv
|
||||
from esphome.components import web_server_base
|
||||
from esphome.components.web_server_base import CONF_WEB_SERVER_BASE_ID
|
||||
from esphome.const import CONF_ID, CONF_NETWORKS, CONF_PASSWORD, CONF_SSID, CONF_WIFI
|
||||
from esphome.const import CONF_ID
|
||||
from esphome.core import coroutine_with_priority, CORE
|
||||
|
||||
AUTO_LOAD = ["web_server_base"]
|
||||
@@ -13,7 +12,6 @@ CODEOWNERS = ["@OttoWinter"]
|
||||
captive_portal_ns = cg.esphome_ns.namespace("captive_portal")
|
||||
CaptivePortal = captive_portal_ns.class_("CaptivePortal", cg.Component)
|
||||
|
||||
CONF_KEEP_USER_CREDENTIALS = "keep_user_credentials"
|
||||
CONFIG_SCHEMA = cv.All(
|
||||
cv.Schema(
|
||||
{
|
||||
@@ -21,7 +19,6 @@ CONFIG_SCHEMA = cv.All(
|
||||
cv.GenerateID(CONF_WEB_SERVER_BASE_ID): cv.use_id(
|
||||
web_server_base.WebServerBase
|
||||
),
|
||||
cv.Optional(CONF_KEEP_USER_CREDENTIALS, default=False): cv.boolean,
|
||||
}
|
||||
).extend(cv.COMPONENT_SCHEMA),
|
||||
cv.only_with_arduino,
|
||||
@@ -29,22 +26,6 @@ CONFIG_SCHEMA = cv.All(
|
||||
)
|
||||
|
||||
|
||||
def validate_wifi(config):
|
||||
wifi_conf = fv.full_config.get()[CONF_WIFI]
|
||||
if config.get(CONF_KEEP_USER_CREDENTIALS, False) and (
|
||||
CONF_SSID in wifi_conf
|
||||
or CONF_PASSWORD in wifi_conf
|
||||
or CONF_NETWORKS in wifi_conf
|
||||
):
|
||||
raise cv.Invalid(
|
||||
f"WiFi credentials cannot be used together with {CONF_KEEP_USER_CREDENTIALS}"
|
||||
)
|
||||
return config
|
||||
|
||||
|
||||
FINAL_VALIDATE_SCHEMA = validate_wifi
|
||||
|
||||
|
||||
@coroutine_with_priority(64.0)
|
||||
async def to_code(config):
|
||||
paren = await cg.get_variable(config[CONF_WEB_SERVER_BASE_ID])
|
||||
@@ -58,6 +39,3 @@ async def to_code(config):
|
||||
cg.add_library("WiFi", None)
|
||||
if CORE.is_esp8266:
|
||||
cg.add_library("DNSServer", None)
|
||||
|
||||
if config.get(CONF_KEEP_USER_CREDENTIALS, False):
|
||||
cg.add_define("USE_CAPTIVE_PORTAL_KEEP_USER_CREDENTIALS")
|
||||
|
||||
@@ -39,11 +39,8 @@ void WiFiComponent::setup() {
|
||||
this->last_connected_ = millis();
|
||||
this->wifi_pre_setup_();
|
||||
|
||||
#ifndef USE_CAPTIVE_PORTAL_KEEP_USER_CREDENTIALS
|
||||
uint32_t hash = fnv1_hash(App.get_compilation_time());
|
||||
#else
|
||||
uint32_t hash = 88491487UL;
|
||||
#endif
|
||||
uint32_t hash = this->has_sta() ? fnv1_hash(App.get_compilation_time()) : 88491487UL;
|
||||
|
||||
this->pref_ = global_preferences->make_preference<wifi::SavedWifiSettings>(hash, true);
|
||||
|
||||
SavedWifiSettings save{};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2022.11.0b5"
|
||||
__version__ = "2022.11.0"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user