def on_nhl_goal(event): if not state_machine.is_enabled("sleep_mode"): speech = f"{event.team} goal scored by number {event.scorer_number}, {event.scorer}." if event.primary_assist: speech = speech + f" Assisted by number {event.primary_number}, {event.primary_assist}" if event.secondary_assist: speech = speech + f" and number {event.secondary_number}, {event.secondary_assist}" TTSAction().add_assistant("living_room").say(speech)
def on_washer_finished(): PushNotifyAction().add_targets( "jim_cell", "erica_cell").set_message("Washing Machine has finished").notify() if not state_machine.is_enabled("sleep_mode"): TTSAction().add_assistants(["living_room_mpd", "master_bedroom_mpd" ]).say("Washer has finished")
def _notify_dryer_finish(): global dryer_start if not state_machine.is_enabled("sleep_mode"): TTSAction().add_assistants(["living_room_mpd", "master_bedroom_mpd" ]).say("Dryer has finished") PushNotifyAction().add_targets( "jim_cell", "erica_cell").set_message("Dryer has finished").notify() dryer_start = None
def on_nhl_period_end(event): if not state_machine.is_enabled("sleep_mode"): TTSAction().add_assistant("living_room").say("End of {}".format( _get_period_num(event.period)))
def on_nhl_game_end(event): if not state_machine.is_enabled("sleep_mode"): TTSAction().add_assistant("living_room").say("The game has ended")
def on_nhl_penalty(event): if not state_machine.is_enabled("sleep_mode"): speech = f"{event.team} penalty on number {event.number}, {event.player}. " speech = speech + f"{event.duration} minute {event.severity} for {event.penalty}." TTSAction().add_assistant("living_room").say(speech)