Affichage des boutons avec un texte personnalisé

This commit is contained in:
2023-10-20 18:06:20 +02:00
parent 4a9a32ef3e
commit fbc469da57
3 changed files with 12 additions and 9 deletions

View File

@@ -1,13 +1,16 @@
class Base {
constructor(id, mm) {
constructor(id, mm, name = "") {
this.id = id;
this.type = id.split(".")[0];
this.name = id;
if (name == "")
this.name = id;
else
this.name = name;
this.mm = mm;
}
updateState(state) {
this.name = (state.attributes || {}).friendly_name || this.id;
//this.name = (state.attributes || {}).friendly_name || this.id;
this.state = state.state;
this.render();
}