From febb59dff9c97fbdb46a91ea6b9a02966dcd4996 Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Wed, 16 Sep 2026 15:23:31 +0200 Subject: [PATCH] Update cookcli-recipe-strategy.js --- dist/cookcli-recipe-strategy.js | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) 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", {