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