REFACTO : Optimisation temps de start
This commit is contained in:
parent
1b3464f06e
commit
47a53dcc60
@ -1,11 +1,17 @@
|
||||
esphome:
|
||||
name: tv2
|
||||
friendly_name: tv2
|
||||
on_boot:
|
||||
then:
|
||||
on_boot:
|
||||
- then:
|
||||
- delay: 1s
|
||||
- output.turn_off: relais
|
||||
- lambda: 'ESP_LOGD("main", "----- boot -----> Relais OFF !");'
|
||||
- output.turn_on: bouton_vert
|
||||
- output.turn_off: bouton_rouge
|
||||
- delay: 1s
|
||||
- output.turn_on: relais
|
||||
- lambda: 'ESP_LOGD("main", "----- boot -----> Relais ON !");'
|
||||
- output.turn_on: bouton_rouge
|
||||
|
||||
esp32:
|
||||
board: esp32-c6-devkitc-1
|
||||
@ -63,7 +69,8 @@ sensor:
|
||||
if (id(from_start_count) < 10) {
|
||||
id(from_start_count)++;
|
||||
id(bouton_rouge).turn_on();
|
||||
id(relais).turn_on();
|
||||
id(relais).turn_on();
|
||||
ESP_LOGD("main", "--> Relais ON !");
|
||||
ESP_LOGD("main", "--> Démarrage... (%d / 10)", id(from_start_count));
|
||||
} else {
|
||||
if (id(puissance_faible)) {
|
||||
@ -73,6 +80,7 @@ sensor:
|
||||
if (id(low_power_count) >= 5) {
|
||||
ESP_LOGD("main", "--> TV OFF !");
|
||||
id(relais).turn_off();
|
||||
ESP_LOGD("main", "--> Relais OFF !");
|
||||
}
|
||||
}
|
||||
on_value_range:
|
||||
@ -89,7 +97,6 @@ sensor:
|
||||
id(puissance_faible) = false;
|
||||
id(bouton_vert).turn_on();
|
||||
id(relais).turn_on();
|
||||
id(low_power_count) = 0;
|
||||
|
||||
ESP_LOGD("main", "--> Relais ON !");
|
||||
id(low_power_count) = 0;
|
||||
update_interval: 5s
|
||||
|
||||
Loading…
Reference in New Issue
Block a user