diff --git a/dist/cookcli-recipe-strategy.js b/dist/cookcli-recipe-strategy.js index 9fca7b3..1bbd92f 100644 --- a/dist/cookcli-recipe-strategy.js +++ b/dist/cookcli-recipe-strategy.js @@ -392,6 +392,58 @@ class CookcliStrategyEditor extends HTMLElement { this._hass = hass; } + // Méthode appelée quand l'utilisateur modifie un champ + _valueChanged(ev) { + if (!this._config || !this._hass) { + return; + } + const target = ev.target; + const newConfig = { ...this._config }; + + // Mettre à jour la clé correspondant au nom du champ + newConfig[target.configValue] = target.value; + + // Informer Home Assistant du changement + this.dispatchEvent( + new CustomEvent("config-changed", { + bubbles: true, + composed: true, + detail: { config: newConfig }, + }) + ); + } + + // Méthode de rendu (obligatoire pour afficher le formulaire) + connectedCallback() { + this.innerHTML = ` +
+ + + +
+ `; + } + configChanged(newConfig) { this.dispatchEvent( new CustomEvent("config-changed", {