Fix format

This commit is contained in:
Rapsssito 2024-08-21 19:27:54 +02:00
parent 0d6b79d714
commit 3f31dc42c4
2 changed files with 11 additions and 7 deletions

View file

@ -486,10 +486,16 @@ async def wifi_disable_to_code(config, action_id, template_arg, args):
return cg.new_Pvariable(action_id, template_arg) return cg.new_Pvariable(action_id, template_arg)
@automation.register_action("wifi.save_ap_settings", WiFiSaveAPSettingsAction, cv.Schema({ @automation.register_action(
cv.Required(CONF_SSID): cv.templatable(cv.ssid), "wifi.save_ap_settings",
cv.Required(CONF_PASSWORD): cv.templatable(validate_password), 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): async def wifi_save_settings_to_code(config, action_id, template_arg, args):
var = cg.new_Pvariable(action_id, template_arg) var = cg.new_Pvariable(action_id, template_arg)
ssid = await cg.templatable(config[CONF_SSID], args, cg.std_string) ssid = await cg.templatable(config[CONF_SSID], args, cg.std_string)

View file

@ -447,9 +447,7 @@ template<typename... Ts> class WiFiSaveAPSettingsAction : public Action<Ts...> {
TEMPLATABLE_VALUE(std::string, password) TEMPLATABLE_VALUE(std::string, password)
void play(Ts... x) override { void play(Ts... x) override {
global_wifi_component->save_wifi_sta( global_wifi_component->save_wifi_sta(this->ssid_.value(x...), this->password_.value(x...));
this->ssid_.value(x...), this->password_.value(x...)
);
} }
}; };