Fixed code typo

This commit is contained in:
Fabio Manganiello 2024-06-03 15:22:43 +02:00
parent 1d90d5a317
commit 9ce776edfa

View file

@ -411,21 +411,21 @@ def pause_music_when_conversation_starts():
# Note: (limited) support for regular expressions on `phrase` # Note: (limited) support for regular expressions on `phrase`
# This hook will match any phrase containing either "turn on the lights" # This hook will match any phrase containing either "turn on the lights"
# or "turn off the lights" # or "turn off the lights"
@when(SpeechRecognizedEvent, phrase="turn on (the?) lights") @when(SpeechRecognizedEvent, phrase="turn on (the)? lights")
def lights_on_command(): def lights_on_command():
run(f"{light_plugin}.on") run(f"{light_plugin}.on")
# Or, with arguments: # Or, with arguments:
# run(f"{light_plugin}.on", groups=["Bedroom"]) # run(f"{light_plugin}.on", groups=["Bedroom"])
@when(SpeechRecognizedEvent, phrase="turn off (the?) lights") @when(SpeechRecognizedEvent, phrase="turn off (the)? lights")
def lights_off_command(): def lights_off_command():
run(f"{light_plugin}.off") run(f"{light_plugin}.off")
@when(SpeechRecognizedEvent, phrase="play (the?) music") @when(SpeechRecognizedEvent, phrase="play (the)? music")
def play_music_command(): def play_music_command():
run(f"{music_plugin}.play") run(f"{music_plugin}.play")
@when(SpeechRecognizedEvent, phrase="stop (the?) music") @when(SpeechRecognizedEvent, phrase="stop (the)? music")
def stop_music_command(): def stop_music_command():
run(f"{music_plugin}.stop") run(f"{music_plugin}.stop")
``` ```