Salut,
Effectivement ça s’adapte mieux à écran avec ce système
. J’ai jamais trop joué avec ces custom cards, t’as l’air de maitriser.
De mon côté j’ai voulu continuer sur mon idée de button-card (car je suis têtu et j’avais envie d’y arriver
)
Après un nombre incalculable d’heures passées (je n’ose même pas calculer combien…) j’ai réussi pas trop mal à tout implémenter dans une seule grosse button-card. Ca m’a permis de découvrir tout ce dont elle était capable (il y a un paquet de choses quand on veut aller loin !). J’ai réussi à coder la logique du registre global en input_text (en réalité c’est pas ça car j’ai pas géré l’endianess mais pour la demo on s’en moque)
Voici ce que ça donne quand on redimensionne:

Le code la custom:button-card (je l’ai tronqué pour que ça ne dépasse pas la limite de caractères du forum):
type: custom:button-card
grid_options:
columns: full
styles:
card:
- overflow: auto
grid:
- grid-template-columns: max-content repeat(24, 1fr)
- grid-template-rows: auto repeat(7, 1fr)
- grid-template-areas: |
"header_day h0_title h1_title h2_title h3_title h4_title h5_title h6_title h7_title h8_title h9_title h10_title h11_title h12_title h13_title h14_title h15_title h16_title h17_title h18_title h19_title h20_title h21_title h22_title h23_title"
"label_lun h0_lun h1_lun h2_lun h3_lun h4_lun h5_lun h6_lun h7_lun h8_lun h9_lun h10_lun h11_lun h12_lun h13_lun h14_lun h15_lun h16_lun h17_lun h18_lun h19_lun h20_lun h21_lun h22_lun h23_lun"
"label_mar h0_mar h1_mar h2_mar h3_mar h4_mar h5_mar h6_mar h7_mar h8_mar h9_mar h10_mar h11_mar h12_mar h13_mar h14_mar h15_mar h16_mar h17_mar h18_mar h19_mar h20_mar h21_mar h22_mar h23_mar"
"label_mer h0_mer h1_mer h2_mer h3_mer h4_mer h5_mer h6_mer h7_mer h8_mer h9_mer h10_mer h11_mer h12_mer h13_mer h14_mer h15_mer h16_mer h17_mer h18_mer h19_mer h20_mer h21_mer h22_mer h23_mer"
"label_jeu h0_jeu h1_jeu h2_jeu h3_jeu h4_jeu h5_jeu h6_jeu h7_jeu h8_jeu h9_jeu h10_jeu h11_jeu h12_jeu h13_jeu h14_jeu h15_jeu h16_jeu h17_jeu h18_jeu h19_jeu h20_jeu h21_jeu h22_jeu h23_jeu"
"label_ven h0_ven h1_ven h2_ven h3_ven h4_ven h5_ven h6_ven h7_ven h8_ven h9_ven h10_ven h11_ven h12_ven h13_ven h14_ven h15_ven h16_ven h17_ven h18_ven h19_ven h20_ven h21_ven h22_ven h23_ven"
"label_sam h0_sam h1_sam h2_sam h3_sam h4_sam h5_sam h6_sam h7_sam h8_sam h9_sam h10_sam h11_sam h12_sam h13_sam h14_sam h15_sam h16_sam h17_sam h18_sam h19_sam h20_sam h21_sam h22_sam h23_sam"
"label_dim h0_dim h1_dim h2_dim h3_dim h4_dim h5_dim h6_dim h7_dim h8_dim h9_dim h10_dim h11_dim h12_dim h13_dim h14_dim h15_dim h16_dim h17_dim h18_dim h19_dim h20_dim h21_dim h22_dim h23_dim"
# ancres de base
hour_title: &hour_title
type: custom:button-card
styles:
name:
- font-size: 0.8em
- margin-left: -100%
card:
- border-style: none
- overflow: visible
day_label: &day_label
type: custom:button-card
styles:
name:
- font-weight: bold
card:
- border-style: none
empty_cell: &empty_cell
card:
type: custom:button-card
label: ""
show_label: true
styles:
card:
- border-radius: 5px
- min-width: 15px
custom_fields:
header_day:
card:
type: custom:button-card
color_type: blank-card
h0_title:
card:
<<: *hour_title
name: "0"
h1_title:
card:
<<: *hour_title
name: "1"
h2_title:
card:
<<: *hour_title
name: "2"
h3_title:
card:
<<: *hour_title
name: "3"
h4_title:
card:
<<: *hour_title
name: "4"
h5_title:
card:
<<: *hour_title
name: "5"
h6_title:
card:
<<: *hour_title
name: "6"
h7_title:
card:
<<: *hour_title
name: "7"
h8_title:
card:
<<: *hour_title
name: "8"
h9_title:
card:
<<: *hour_title
name: "9"
h10_title:
card:
<<: *hour_title
name: "10"
h11_title:
card:
<<: *hour_title
name: "11"
h12_title:
card:
<<: *hour_title
name: "12"
h13_title:
card:
<<: *hour_title
name: "13"
h14_title:
card:
<<: *hour_title
name: "14"
h15_title:
card:
<<: *hour_title
name: "15"
h16_title:
card:
<<: *hour_title
name: "16"
h17_title:
card:
<<: *hour_title
name: "17"
h18_title:
card:
<<: *hour_title
name: "18"
h19_title:
card:
<<: *hour_title
name: "19"
h20_title:
card:
<<: *hour_title
name: "20"
h21_title:
card:
<<: *hour_title
name: "21"
h22_title:
card:
<<: *hour_title
name: "22"
h23_title:
card:
<<: *hour_title
name: "23"
label_lun:
card:
<<: *day_label
name: Lun
h0_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 0
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 0;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h1_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 1
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 1;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h2_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 2
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 2;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h3_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 3
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 3;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h4_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 4
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 4;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h5_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 5
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 5;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h6_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 6
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 6;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h7_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 7
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 7;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h8_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 8
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 8;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h9_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 9
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 9;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h10_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 10
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 10;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h11_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 11
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 11;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h12_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 12
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 12;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h13_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 13
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 13;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h14_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 14
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 14;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h15_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 15
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 15;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h16_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 16
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 16;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h17_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 17
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 17;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h18_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 18
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 18;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h19_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 19
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 19;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h20_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 20
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 20;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h21_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 21
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 21;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h22_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 22
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 22;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h23_lun:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 23
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 23;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
label_mar:
card:
<<: *day_label
name: Mar
h0_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 24
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 24;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h1_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 25
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 25;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h2_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 26
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 26;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h3_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 27
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 27;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h4_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 28
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 28;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h5_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 29
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 29;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h6_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 30
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 30;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h7_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 31
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 31;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h8_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 32
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 32;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h9_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 33
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 33;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h10_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 34
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 34;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h11_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 35
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 35;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h12_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 36
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 36;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h13_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 37
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 37;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h14_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 38
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 38;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h15_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 39
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 39;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h16_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 40
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 40;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h17_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 41
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 41;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h18_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 42
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 42;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h19_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 43
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 43;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h20_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 44
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 44;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h21_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 45
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 45;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h22_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 46
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 46;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h23_mar:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 47
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 47;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
label_mer:
card:
<<: *day_label
name: Mer
h0_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 48
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 48;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h1_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 49
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 49;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h2_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 50
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 50;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h3_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 51
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 51;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h4_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 52
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 52;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h5_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 53
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 53;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h6_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 54
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 54;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h7_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 55
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 55;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h8_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 56
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 56;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h9_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 57
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 57;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h10_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 58
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 58;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h11_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 59
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 59;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h12_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 60
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 60;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h13_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 61
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 61;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h14_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 62
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 62;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h15_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 63
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 63;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h16_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 64
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 64;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h17_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 65
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 65;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h18_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 66
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 66;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h19_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 67
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 67;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h20_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 68
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 68;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h21_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 69
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 69;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h22_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 70
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 70;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h23_mer:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 71
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 71;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
label_jeu:
card:
<<: *day_label
name: Jeu
h0_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 72
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 72;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h1_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 73
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 73;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h2_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 74
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 74;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h3_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 75
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 75;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h4_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 76
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 76;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h5_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 77
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 77;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h6_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 78
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 78;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h7_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 79
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 79;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h8_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 80
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 80;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h9_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 81
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 81;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h10_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 82
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 82;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h11_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 83
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 83;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h12_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 84
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 84;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h13_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 85
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 85;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h14_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 86
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 86;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h15_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 87
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 87;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h16_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 88
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 88;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h17_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 89
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 89;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h18_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 90
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 90;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h19_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 91
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 91;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h20_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 92
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 92;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h21_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 93
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 93;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h22_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 94
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 94;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h23_jeu:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 95
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 95;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
label_ven:
card:
<<: *day_label
name: Ven
h0_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 96
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 96;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h1_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 97
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 97;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h2_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 98
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 98;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h3_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 99
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 99;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h4_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 100
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 100;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h5_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 101
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 101;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h6_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 102
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 102;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h7_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 103
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 103;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h8_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 104
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 104;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h9_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 105
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 105;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h10_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 106
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 106;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h11_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 107
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 107;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h12_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 108
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 108;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h13_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 109
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 109;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h14_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 110
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 110;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h15_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 111
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 111;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h16_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 112
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 112;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h17_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 113
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 113;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h18_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 114
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 114;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h19_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 115
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 115;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h20_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 116
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 116;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h21_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 117
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 117;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h22_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 118
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 118;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
h23_ven:
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
index: 119
styles:
card:
- border-radius: 5px
- min-width: 15px
- background-color: >
[[[
// Récupérer le buffer (string hex)
const buffer = states['input_text.proga_buffer'].state;
if (!buffer || buffer.length < 56 ) return "red";
const index = 119;
// Calcul byte/bit
const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);
const bit_index = index % 8;
const hex = buffer.substr(byte_index * 2, 2);
const byte = parseInt(hex, 16);
const bit = (byte >> bit_index) & 1;
return bit === 1 ? "green" : "white";
]]]
Le python pour la générer:
# Génère le YAML complet (7 jours × 24 heures) avec ancres et alias
header = """type: custom:button-card
grid_options:
columns: full
styles:
card:
- overflow: auto
grid:
- grid-template-columns: max-content repeat(24, 1fr)
- grid-template-rows: auto repeat(7, 1fr)
- grid-template-areas: |
"header_day h0_title h1_title h2_title h3_title h4_title h5_title h6_title h7_title h8_title h9_title h10_title h11_title h12_title h13_title h14_title h15_title h16_title h17_title h18_title h19_title h20_title h21_title h22_title h23_title"
"label_lun h0_lun h1_lun h2_lun h3_lun h4_lun h5_lun h6_lun h7_lun h8_lun h9_lun h10_lun h11_lun h12_lun h13_lun h14_lun h15_lun h16_lun h17_lun h18_lun h19_lun h20_lun h21_lun h22_lun h23_lun"
"label_mar h0_mar h1_mar h2_mar h3_mar h4_mar h5_mar h6_mar h7_mar h8_mar h9_mar h10_mar h11_mar h12_mar h13_mar h14_mar h15_mar h16_mar h17_mar h18_mar h19_mar h20_mar h21_mar h22_mar h23_mar"
"label_mer h0_mer h1_mer h2_mer h3_mer h4_mer h5_mer h6_mer h7_mer h8_mer h9_mer h10_mer h11_mer h12_mer h13_mer h14_mer h15_mer h16_mer h17_mer h18_mer h19_mer h20_mer h21_mer h22_mer h23_mer"
"label_jeu h0_jeu h1_jeu h2_jeu h3_jeu h4_jeu h5_jeu h6_jeu h7_jeu h8_jeu h9_jeu h10_jeu h11_jeu h12_jeu h13_jeu h14_jeu h15_jeu h16_jeu h17_jeu h18_jeu h19_jeu h20_jeu h21_jeu h22_jeu h23_jeu"
"label_ven h0_ven h1_ven h2_ven h3_ven h4_ven h5_ven h6_ven h7_ven h8_ven h9_ven h10_ven h11_ven h12_ven h13_ven h14_ven h15_ven h16_ven h17_ven h18_ven h19_ven h20_ven h21_ven h22_ven h23_ven"
"label_sam h0_sam h1_sam h2_sam h3_sam h4_sam h5_sam h6_sam h7_sam h8_sam h9_sam h10_sam h11_sam h12_sam h13_sam h14_sam h15_sam h16_sam h17_sam h18_sam h19_sam h20_sam h21_sam h22_sam h23_sam"
"label_dim h0_dim h1_dim h2_dim h3_dim h4_dim h5_dim h6_dim h7_dim h8_dim h9_dim h10_dim h11_dim h12_dim h13_dim h14_dim h15_dim h16_dim h17_dim h18_dim h19_dim h20_dim h21_dim h22_dim h23_dim"
# ancres de base
hour_title: &hour_title
type: custom:button-card
styles:
name:
- font-size: 0.8em
- margin-left: -100%
card:
- border-style: none
- overflow: visible
day_label: &day_label
type: custom:button-card
styles:
name:
- font-weight: bold
card:
- border-style: none
empty_cell: &empty_cell
card:
type: custom:button-card
label: ""
show_label: true
styles:
card:
- border-radius: 5px
- min-width: 15px
custom_fields:
header_day:
card:
type: custom:button-card
color_type: blank-card
"""
empty_cell_card="""
card:
type: custom:button-card
label: ""
show_label: true
tap_action:
action: perform-action
perform_action: script.toggle_prog_bit
data:
prog: "A"
"""
empty_cell_styles="""
styles:
card:
- border-radius: 5px
- min-width: 15px
"""
jours = ["lun","mar","mer","jeu","ven","sam","dim"]
with open("lovelace_schedule.yaml","w",encoding="utf-8") as f:
f.write(header)
for h in range(24):
f.write(f" h{h}_title:\n card:\n <<: *hour_title\n name: \"{h}\"\n")
for j in jours:
f.write(f"\n label_{j}:\n card:\n <<: *day_label\n name: {j.capitalize()}\n")
for h in range(24):
# f.write(f" h{h}_{j}:\n <<: *empty_cell\n")
f.write(f" h{h}_{j}:\n"+empty_cell_card)
f.write(" index: "+str(jours.index(j)*24 + h))
f.write(empty_cell_styles)
f.write(" - background-color: >\n")
f.write(" [[[\n")
f.write(" // Récupérer le buffer (string hex)\n")
f.write(" const buffer = states['input_text.proga_buffer'].state;\n")
f.write(" if (!buffer || buffer.length < 56 ) return \"red\";\n")
f.write
f.write(" const index = "+str(jours.index(j)*24 + h)+"; \n")
f.write
f.write(" // Calcul byte/bit\n")
f.write(" const byte_index = 4 * Math.floor(index / 24) + 3 - Math.floor((index % 24) / 8);\n")
f.write(" const bit_index = index % 8;\n")
f.write
f.write(" const hex = buffer.substr(byte_index * 2, 2);\n")
f.write(" const byte = parseInt(hex, 16);\n")
f.write
f.write(" const bit = (byte >> bit_index) & 1;\n")
f.write
f.write(" return bit === 1 ? \"green\" : \"white\";\n")
f.write(" ]]]\n")
print('Fichier "lovelace_schedule.yaml" généré')
Et le script Home Assistant toogle_prog_bit:
sequence:
- variables:
buffer_entity: "{{ 'input_text.prog' + prog + '_buffer' }}"
buffer: "{{ states(buffer_entity) }}"
byte_index: "{{ 4 * (index // 24) + 3 - (index % 24 // 8)| int }}"
bit_index: "{{ (index % 8) | int }}"
old_byte_str: "{{ buffer[byte_index*2 : byte_index*2 + 2] | string }}"
old_byte_val: "{{ int(old_byte_str | string, 0, 16) }}"
bit_val: "{{ (old_byte_val // (2 ** bit_index)) % 2 }}"
new_byte_val: |-
{% if bit_val == 1 %}
{{ (old_byte_val - (2 ** bit_index)) }}
{% else %}
{{ (old_byte_val + (2 ** bit_index)) }}
{% endif %}
new_byte: "{{ '{:02X}'.format(new_byte_val|int) }}"
new_buf: "{{ buffer[:byte_index*2] ~ new_byte ~ buffer[byte_index*2 + 2:] }}"
- target:
entity_id: "{{ buffer_entity }}"
data:
value: "{{ new_buf }}"
action: input_text.set_value
description: Toggle un bit dans un programme
fields:
prog:
description: Programme (A/B/C/D)
example: A
index:
description: Index du bit (0-167)
example: 0
alias: toggle_prog_bit
Maintenant je me bats avec ESPhome, c’est pas si évident que ça en l’air pour synchroniser les deux, mais je tiens le bon bout 
En tout cas merci pour vos solutions, ça va me servir.
Edit: J’ai mis à jour avec la correction pour gérer l’endianess