From 4258b226a429f60c1bce39e3af9da89dd12ac7f8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 5 Oct 2026 10:26:22 -0500 Subject: [PATCH] [wifi] Default LN882x power save to none, as on BK72xx and RTL87xx (#20170) --- esphome/components/wifi/__init__.py | 2 +- tests/component_tests/wifi/config/bare_ln882x.yaml | 12 ++++++++++++ tests/component_tests/wifi/test_default_setters.py | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tests/component_tests/wifi/config/bare_ln882x.yaml diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index fa552da969..553c737dbc 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -514,7 +514,7 @@ CONFIG_SCHEMA = cv.All( rp2="light", bk72xx="none", rtl87xx="none", - ln882x="light", + ln882x="none", ): cv.enum(WIFI_POWER_SAVE_MODES, upper=True), cv.Optional(CONF_FAST_CONNECT, default=False): _fast_connect_schema, cv.Optional(CONF_USE_ADDRESS): cv.string_strict, diff --git a/tests/component_tests/wifi/config/bare_ln882x.yaml b/tests/component_tests/wifi/config/bare_ln882x.yaml new file mode 100644 index 0000000000..885a469b8d --- /dev/null +++ b/tests/component_tests/wifi/config/bare_ln882x.yaml @@ -0,0 +1,12 @@ +--- +esphome: + name: test + +ln882x: + board: generic-ln882h + +wifi: + ssid: test + password: testtest + ap: + ssid: fallback diff --git a/tests/component_tests/wifi/test_default_setters.py b/tests/component_tests/wifi/test_default_setters.py index b326f3eaee..dfac443060 100644 --- a/tests/component_tests/wifi/test_default_setters.py +++ b/tests/component_tests/wifi/test_default_setters.py @@ -6,7 +6,9 @@ from pathlib import Path import pytest -@pytest.mark.parametrize("config_file", ["bare.yaml", "defaults.yaml"]) +@pytest.mark.parametrize( + "config_file", ["bare.yaml", "defaults.yaml", "bare_ln882x.yaml"] +) def test_default_values_are_not_emitted( generate_main: Callable[[str | Path], str], component_config_path: Callable[[str], Path],