Fixed battery low management

This commit is contained in:
2026-04-09 10:56:29 +02:00
parent 8b64c0a986
commit d25b6ccb6c

View File

@@ -15,6 +15,7 @@ esphome:
- priority: -100
# When all is set up. Start the show.
then:
- delay: 5s
- script.execute: game_ready_animation
# Variables
@@ -231,9 +232,9 @@ script:
r: !lambda if (id(game_selected_section) < 3) return 0.0; else return 1.0;
g: !lambda if (id(game_selected_section) == 0 || id(game_selected_section) == 3 || id(game_selected_section) == 4) return 0.0; else return 1.0;
b: !lambda if (id(game_selected_section) % 2 == 0) return 1.0; else return 0.0;
- logger.log:
format: "Selected section %d"
args: [ 'id(game_selected_section)' ]
#- logger.log:
# format: "Selected section %d"
# args: [ 'id(game_selected_section)' ]
- id: game_play_section
then:
- rtttl.play:
@@ -255,14 +256,16 @@ script:
}
- id: battery_low
then:
- logger.log: "Executing Battery Low script"
# Turn lughts on red
- light.turn_on:
id: hexagon_sections
brightness: 100%
red: 100%
green: 0%
blue: 0%
#- logger.log: "Executing Battery Low script"
# Turn lights on red
- light.turn_off: hexagon_sections
- delay: 1s
- script.execute:
id: set_section_color
section: 0
r: 1.0
g: 0.0
b: 0.0
- delay: 1s
# Play battery low tune
- rtttl.play: