diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index 5856442877..ac31b340f7 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -214,9 +214,9 @@ def _apply_min_auth_mode_default(config): "If your router supports WPA2 or WPA3, no action is needed - the new default will be more secure. " "If your router only supports WPA, explicitly set 'min_auth_mode: WPA' to maintain compatibility." ) - config[CONF_MIN_AUTH_MODE] = WifiMinAuthMode.WIFI_MIN_AUTH_MODE_WPA + config[CONF_MIN_AUTH_MODE] = "WPA" elif CORE.is_esp32: - config[CONF_MIN_AUTH_MODE] = WifiMinAuthMode.WIFI_MIN_AUTH_MODE_WPA2 + config[CONF_MIN_AUTH_MODE] = "WPA2" return config @@ -459,7 +459,7 @@ async def to_code(config): cg.add(var.set_reboot_timeout(config[CONF_REBOOT_TIMEOUT])) cg.add(var.set_power_save_mode(config[CONF_POWER_SAVE_MODE])) if CONF_MIN_AUTH_MODE in config: - cg.add(var.set_min_auth_mode(config[CONF_MIN_AUTH_MODE])) + cg.add(var.set_min_auth_mode(WIFI_MIN_AUTH_MODES[config[CONF_MIN_AUTH_MODE]])) if config[CONF_FAST_CONNECT]: cg.add_define("USE_WIFI_FAST_CONNECT") cg.add(var.set_passive_scan(config[CONF_PASSIVE_SCAN]))