Buzzer
Smart HomeThe house’s buzzer; frequencies are in hertz and durations in milliseconds.
How you reach it
Section titled “How you reach it”The Buzzer class is reached through this attribute of home.
home.buzzer
Section titled “home.buzzer”Always there.
All the attributes of home are in its table.
Methods
Section titled “Methods”play_tone(frequency, duration)
Section titled “play_tone(frequency, duration)”Plays a tone of frequency hertz for duration milliseconds, and waits until it ends.
play_tone(frequency, duration)Used in examples: Hello, house, Doorbell
play_note(note, duration)
Section titled “play_note(note, duration)”Plays a note by name, "C3" to "B6" (for example "A4"), for duration milliseconds, and waits until it ends.
play_note(note, duration)Used in examples: Hello, house, Web dashboard, Doorbell
play_notes(sequence)
Section titled “play_notes(sequence)”Plays a list of (note, milliseconds) pairs in the background, for example [("C5", 100), ("E5", 200)]; returns at once.
play_notes(sequence)Used in examples: Hello, house
stop()
Section titled “stop()”Stops the notes playing in the background.
stop()Used in examples: Hello, house
is_playing()
Section titled “is_playing()”True while play_notes() is still playing.
is_playing() -> boolUsed in examples: Hello, house