mirror of
https://github.com/esphome/esphome.git
synced 2026-09-28 15:30:21 +00:00
51 lines
1.7 KiB
YAML
51 lines
1.7 KiB
YAML
esphome:
|
|
on_boot:
|
|
then:
|
|
- rtttl.play: 'siren:d=8,o=5,b=100:d,e,d,e,d,e,d,e'
|
|
- rtttl.stop
|
|
# Test all note features: all notes, denominators (1,2,4,8,16,32), sharp (#), octaves (4-7), dotted (.), note gap (c5,c5), pause (p)
|
|
- rtttl.play: 'special:d=4,o=5,b=120:1c4,2d#5,4e6.,8f#7,16g4,32a5,8a#5,4b6,8h5,c5,c5,8p,2c4'
|
|
# Different orders of control parameters
|
|
- rtttl.play: 'test_odb:o=5,d=8,b=100:c'
|
|
- rtttl.play: 'test_bod:b=100,o=5,d=8:c'
|
|
- rtttl.play: 'test_bdo:b=100,d=8,o=5:c'
|
|
- rtttl.play: 'test_obd:o=5,b=100,d=8:c'
|
|
- rtttl.play: 'test_dbo:d=8,b=100,o=5:c'
|
|
# Missing parameters (use defaults)
|
|
- rtttl.play: 'test_no_d:o=5,b=100:c'
|
|
- rtttl.play: 'test_no_o:d=8,b=100:c'
|
|
- rtttl.play: 'test_no_b:d=8,o=5:c'
|
|
- rtttl.play: 'test_only_d:d=8:c'
|
|
- rtttl.play: 'test_only_o:o=5:c'
|
|
- rtttl.play: 'test_only_b:b=100:c'
|
|
- rtttl.play: 'test_empty::c'
|
|
# Long form with an explicit id, a lambda song, and the is_playing condition
|
|
- rtttl.play:
|
|
id: rtttl_player
|
|
rtttl: 'test_long_form:d=8,o=5,b=100:c'
|
|
- rtttl.play:
|
|
rtttl: !lambda return std::string("test_lambda:d=8,o=5,b=100:c");
|
|
- if:
|
|
condition:
|
|
rtttl.is_playing:
|
|
id: rtttl_player
|
|
then:
|
|
- rtttl.stop:
|
|
id: rtttl_player
|
|
|
|
output:
|
|
- platform: ${output_platform}
|
|
id: rtttl_output
|
|
pin: ${pin}
|
|
frequency: 1500Hz
|
|
max_power: 0.5
|
|
|
|
rtttl:
|
|
id: rtttl_player
|
|
output: rtttl_output
|
|
on_finished_playback:
|
|
- then:
|
|
- logger.log: "Playback finished 1"
|
|
- then:
|
|
- logger.log: "Playback finished 2"
|