瀏覽代碼

Added matsal to state goto

pi 3 年之前
父節點
當前提交
dd14da8e07
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      pyscript/state_goto.py

+ 4 - 0
pyscript/state_goto.py

@@ -28,6 +28,7 @@ def state_goto_all_on():
     cs = getCurrentState()
     log.info(f"********* ALL ON *********** State: " + str(cs) )
     light.turn_on(entity_id='light.tradfri_bulb')
+    switch.turn_on(entity_id='switch.matsal')
     for x in range(2):
         switch.turn_on(entity_id='switch.group_button_all')
         task.sleep(0.5)
@@ -45,6 +46,7 @@ def state_goto_window():
     cs = getCurrentState()
     log.info(f"********* WINDOW *********** State: " + str(cs) )
     light.turn_off(entity_id='light.tradfri_bulb')
+    switch.turn_off(entity_id='switch.matsal')
     
     if cs == 4 or cs == 2:  # From Off or already Window
         for x in range(2):
@@ -76,6 +78,7 @@ def state_goto_morning():
     cs = getCurrentState()
     log.info(f"********* MORNING *********** State: " + str(cs) )
     light.turn_off(entity_id='light.tradfri_bulb')
+    switch.turn_off(entity_id='switch.matsal')
     if cs == 4 or cs == 3:  # Off or already Morning
         for x in range(2):
             light.turn_on(entity_id=' light.main_button_4')
@@ -110,6 +113,7 @@ def state_goto_all_off():
     cs = getCurrentState()
     log.info(f"********* ALL OFF *********** State: " + str(cs) )
     light.turn_off(entity_id='light.tradfri_bulb')
+    switch.turn_off(entity_id='switch.matsal')
     switch.turn_off(entity_id='switch.tradfri_outlet')  # Sovrum OFF
     for x in range(2):
         switch.turn_off(entity_id='switch.group_button_all')