mirror of
https://github.com/esphome/esphome.git
synced 2024-12-24 14:34:54 +01:00
Fix lint
This commit is contained in:
parent
eef6236bc9
commit
be7adba352
3 changed files with 5 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -457,7 +457,7 @@ template<typename... Ts> class WiFiSetSTAAction : public Action<Ts...>, 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<typename... Ts> class WiFiSetSTAAction : public Action<Ts...>, public C
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
bool connecting_{false};
|
||||
WiFiAP new_sta_;
|
||||
|
|
|
@ -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!"
|
||||
|
|
Loading…
Reference in a new issue