From 3f31dc42c4d0e3342ad36035f934559db203f3b0 Mon Sep 17 00:00:00 2001 From: Rapsssito Date: Wed, 21 Aug 2024 19:27:54 +0200 Subject: [PATCH] Fix format --- esphome/components/wifi/__init__.py | 14 ++++++++++---- esphome/components/wifi/wifi_component.h | 4 +--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index a364e9861c..1dca38bb69 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -486,10 +486,16 @@ async def wifi_disable_to_code(config, action_id, template_arg, args): return cg.new_Pvariable(action_id, template_arg) -@automation.register_action("wifi.save_ap_settings", WiFiSaveAPSettingsAction, cv.Schema({ - cv.Required(CONF_SSID): cv.templatable(cv.ssid), - cv.Required(CONF_PASSWORD): cv.templatable(validate_password), -})) +@automation.register_action( + "wifi.save_ap_settings", + WiFiSaveAPSettingsAction, + cv.Schema( + { + cv.Required(CONF_SSID): cv.templatable(cv.ssid), + cv.Required(CONF_PASSWORD): cv.templatable(validate_password), + } + ) +) async def wifi_save_settings_to_code(config, action_id, template_arg, args): var = cg.new_Pvariable(action_id, template_arg) ssid = await cg.templatable(config[CONF_SSID], args, cg.std_string) diff --git a/esphome/components/wifi/wifi_component.h b/esphome/components/wifi/wifi_component.h index 7dffcfe9a7..8722e83297 100644 --- a/esphome/components/wifi/wifi_component.h +++ b/esphome/components/wifi/wifi_component.h @@ -447,9 +447,7 @@ template class WiFiSaveAPSettingsAction : public Action { TEMPLATABLE_VALUE(std::string, password) void play(Ts... x) override { - global_wifi_component->save_wifi_sta( - this->ssid_.value(x...), this->password_.value(x...) - ); + global_wifi_component->save_wifi_sta(this->ssid_.value(x...), this->password_.value(x...)); } };