def on_motion_triggered(event):
    logger.info("Landing motion detected")

    timer_manager.cancel_timer("landing_motion_timer")

    if not state_machine.is_enabled(
            "indoor_movie_mode") and state_machine.is_enabled(
                "motion_lighting"):
        LightAction().add_light("landing_light").turn_on()
Example #2
0
def on_motion_triggered(event):
    logger.info("Hallway motion detected")

    timer_manager.cancel_timer("hallway_motion_timer")
    if not state_machine.is_enabled(
            "indoor_movie_mode",
            "privacy_mode") and state_machine.is_enabled("motion_lighting"):
        if not state_machine.is_enabled("sleep_mode"):
            LightAction().add_light("hallway_lights").turn_on()
        else:
            LightAction().add_lights(["first_floor_staircase_led"]).turn_on()
Example #3
0
def handle_stop_timer(intent, source, raw, slotMap):
    if not "timer_name" in slotMap:
        logger.error("Must have name of timer")
        return

    if source not in assistant_list:
        logger.error("Invalid source room supplied")
        return

    name = slotMap["timer_name"]["value"]
    timer_manager.cancel_timer(name)
    AssistantAction().add_assistant(source).tts_say(
        "{} timer cancelled".format(name))
Example #4
0
def on_motion_triggered(event):
    logger.info("Kitchen motion detected")

    timer_manager.cancel_timer("landing_motion_timer")
    timer_manager.cancel_timer("kitchen_motion_timer")

    if not state_machine.is_enabled(
            "indoor_movie_mode") and state_machine.is_enabled(
                "motion_lighting"):
        LightAction().add_light("landing_light").turn_on()

    if not state_machine.is_enabled(
            "outdoor_movie_mode", "indoor_movie_mode"
    ) and state_machine.is_enabled("motion_lighting"):
        LightAction().add_light("kitchen_cabinet_lights").turn_on(
            color_temp=400)

        if not state_machine.is_enabled("sleep_mode"):
            LightAction().add_light("kitchen_lights").turn_on()
def on_disabled(event):
    timer_manager.cancel_timer("white_noise_restart")
    media_action = MediaPlayerAction().add_media_player("master_bedroom_mpd")
    media_action.stop()
    media_action.clear_playlist()
Example #6
0
def on_available(event):
    logger.info(f"Received available for {event.name}")
    timer_manager.cancel_timer(f"{event.name}_unavailable_timer")
Example #7
0
def on_door_opened(event):
    logger.info("Jim Closet door opened")

    timer_manager.cancel_timer("jim_closet_door_timer")

    LightAction().add_light("jim_closet_light").turn_on()
def on_motion_triggered(event):
    logger.info("Erica closet motion detected")

    timer_manager.cancel_timer("erica_closet_motion_timer")
    if state_machine.is_enabled("motion_lighting"):
        LightAction().add_light("erica_closet_light").turn_on()
Example #9
0
def on_motion_triggered(event):
    logger.info("Fourth bedroom motion detected")
    
    timer_manager.cancel_timer("fourth_bedroom_motion_timer")
    if state_machine.is_enabled("motion_lighting"):
        LightAction().add_light("fourth_bedroom_fixture").turn_on()
Example #10
0
def on_washer_on_event(event):
    logger.info("Washer turned on")
    timer_manager.cancel_timer("laundry_washer_timer")
def on_motion_triggered(event):
    logger.info("Garage motion detected")

    timer_manager.cancel_timer("garage_motion_timer")
    if state_machine.is_enabled("motion_lighting"):
        LightAction().add_light("garage_lights").turn_on()
def on_door_opened(event):
    logger.info("Attic door opened")

    timer_manager.cancel_timer("attic_door_timer")

    LightAction().add_light("attic_lights").turn_on()