mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 11:26:39 +00:00
[wifi] Accept boolean-like strings for fast_connect again
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from esphome import automation, preferences
|
from esphome import automation, preferences
|
||||||
from esphome.automation import Condition
|
from esphome.automation import Condition
|
||||||
@@ -444,9 +445,10 @@ FAST_CONNECT_SCHEMA = cv.Schema(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _fast_connect_schema(value):
|
def _fast_connect_schema(value: Any) -> ConfigType:
|
||||||
"""Accept the historic plain boolean or a dict with enabled/storage keys."""
|
"""Accept the historic plain boolean (including boolean-like strings from
|
||||||
if isinstance(value, bool):
|
substitutions) or a dict with enabled/storage keys."""
|
||||||
|
if not isinstance(value, dict):
|
||||||
value = {CONF_ENABLED: value}
|
value = {CONF_ENABLED: value}
|
||||||
return FAST_CONNECT_SCHEMA(value)
|
return FAST_CONNECT_SCHEMA(value)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# fast_connect passed through a substitution arrives as a string ("false"),
|
||||||
|
# which must be accepted like the historic plain boolean form.
|
||||||
|
substitutions:
|
||||||
|
fast_connect_value: "false"
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
ssid: MySSID
|
||||||
|
password: password1
|
||||||
|
fast_connect: ${fast_connect_value}
|
||||||
Reference in New Issue
Block a user