From eb1d73fea32bd564c5a600919932cb86afa059f7 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 4 Oct 2026 20:00:56 -0500 Subject: [PATCH] [wifi] Tighten the LN882x roaming comment and test --- esphome/components/wifi/__init__.py | 4 +--- tests/component_tests/wifi/test_default_setters.py | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index dc4f95d843..9d9e25f5d3 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -542,9 +542,7 @@ CONFIG_SCHEMA = cv.All( ), cv.Optional(CONF_PASSIVE_SCAN, default=False): cv.boolean, cv.Optional(CONF_ENABLE_ON_BOOT, default=True): cv.boolean, - # An LN882H scan takes the radio off the AP long enough to drop - # the association, so the post-connect roam check costs a - # disconnect there. + # An LN882H scan drops the association, so roaming costs a disconnect there. cv.SplitDefault( CONF_POST_CONNECT_ROAMING, esp8266=True, diff --git a/tests/component_tests/wifi/test_default_setters.py b/tests/component_tests/wifi/test_default_setters.py index 61c721e823..3cbb8f5c94 100644 --- a/tests/component_tests/wifi/test_default_setters.py +++ b/tests/component_tests/wifi/test_default_setters.py @@ -23,6 +23,7 @@ def test_default_values_are_not_emitted( assert "set_reboot_timeout(" not in main_cpp assert "set_power_save_mode(" not in main_cpp assert "set_min_auth_mode(" not in main_cpp + assert "set_post_connect_roaming(" not in main_cpp def test_custom_values_are_emitted( @@ -43,7 +44,7 @@ def test_ln882x_skips_post_connect_roaming( generate_main: Callable[[str | Path], str], component_config_path: Callable[[str], Path], ) -> None: - """An LN882H scan drops the association, so LN882x does not roam by default.""" + """LN882x defaults post_connect_roaming off.""" main_cpp = generate_main(component_config_path("bare_ln882x.yaml")) assert "set_post_connect_roaming(false);" in main_cpp