Update cookcli-card.js

This commit is contained in:
TheThomaas 2026-09-16 16:03:19 +02:00
parent ea4a18ea46
commit 6f96610834

46
dist/cookcli-card.js vendored
View file

@ -50,39 +50,19 @@ class CookCliCard extends HTMLElement {
this._render(); this._render();
} }
/** /**
* Éditeur de configuration automatique intégré à Home Assistant. * Éditeur de configuration automatique intégré à Home Assistant.
* HA utilise ce schéma pour générer le formulaire visuel. * HA utilise ce schéma pour générer le formulaire visuel.
*/ */
static getConfigForm() { static getConfigForm() {
return { return {
schema: [ schema: [
{ { name: "title", selector: { text: {} }, label: "Titre" },
name: "title", { name: "dashboard_path", selector: { text: {} }, label: "Chemin du dashboard", helper: "Laisser vide pour le dashboard courant" },
selector: { text: {} }, { name: "entry_id", selector: { text: {} }, label: "Entry ID", helper: "Optionnel — si plusieurs serveurs CookCLI" },
}, ],
{ };
name: "dashboard_path", }
selector: { text: {} },
helper: "Laisser vide pour naviguer dans le dashboard courant",
},
{
name: "entry_id",
selector: { text: {} },
helper: "Optionnel — ID d'entrée si plusieurs serveurs CookCLI",
},
],
// Fonction optionnelle pour personnaliser les libellés
computeLabel: (schema) => {
const labels = {
title: "Titre",
dashboard_path: "Chemin du dashboard",
entry_id: "Entry ID",
};
return labels[schema.name] || schema.name;
},
};
}
set hass(hass) { set hass(hass) {
this._hass = hass; this._hass = hass;