From be7adba3528f8a70fd9fd3b6aec6fc34ac820215 Mon Sep 17 00:00:00 2001 From: Rapsssito Date: Tue, 17 Sep 2024 12:34:32 +0200 Subject: [PATCH] Fix lint --- esphome/components/wifi/__init__.py | 5 ++--- esphome/components/wifi/wifi_component.h | 4 ++-- tests/components/wifi/common.yaml | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index d89244395f..dc10e07060 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -67,6 +67,7 @@ WiFiEnableAction = wifi_ns.class_("WiFiEnableAction", automation.Action) WiFiDisableAction = wifi_ns.class_("WiFiDisableAction", automation.Action) WiFiSetSTAAction = wifi_ns.class_("WiFiSetSTAAction", automation.Action, cg.Component) + def validate_password(value): value = cv.string_strict(value) if not value: @@ -515,8 +516,6 @@ async def wifi_set_sta_to_code(config, action_id, template_arg, args): var.get_connect_trigger(), [], on_connect_config ) if on_error_config := config.get(CONF_ON_ERROR): - await automation.build_automation( - var.get_error_trigger(), [], on_error_config - ) + await automation.build_automation(var.get_error_trigger(), [], on_error_config) await cg.register_component(var, config) return var diff --git a/esphome/components/wifi/wifi_component.h b/esphome/components/wifi/wifi_component.h index 77f4b35f37..22c2db5dbc 100644 --- a/esphome/components/wifi/wifi_component.h +++ b/esphome/components/wifi/wifi_component.h @@ -457,7 +457,7 @@ template class WiFiSetSTAAction : public Action, public C // If already connected to the same AP, do nothing if (global_wifi_component->wifi_ssid() == ssid) { // Callback to notify the user that the connection was successful - this->connect_trigger_->trigger(); + this->connect_trigger_->trigger(); return; } // Set the state to connecting @@ -506,7 +506,7 @@ template class WiFiSetSTAAction : public Action, public C } } } - + protected: bool connecting_{false}; WiFiAP new_sta_; diff --git a/tests/components/wifi/common.yaml b/tests/components/wifi/common.yaml index 9c4870818b..b1346bd534 100644 --- a/tests/components/wifi/common.yaml +++ b/tests/components/wifi/common.yaml @@ -6,7 +6,7 @@ esphome: - wifi.set_sta: ssid: MySSID password: password1 - on_connect: + on_connect: - logger.log: "Connected to WiFi!" on_error: - logger.log: "Failed to connect to WiFi!"