mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 23:48:11 +01:00
Fix format
This commit is contained in:
parent
0d6b79d714
commit
3f31dc42c4
2 changed files with 11 additions and 7 deletions
|
@ -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)
|
||||
|
|
|
@ -447,9 +447,7 @@ template<typename... Ts> class WiFiSaveAPSettingsAction : public Action<Ts...> {
|
|||
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...));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue