|
@@ -30,13 +30,11 @@ def state_goto_all_on():
|
|
light.turn_on(entity_id='light.tradfri_bulb')
|
|
light.turn_on(entity_id='light.tradfri_bulb')
|
|
for x in range(2):
|
|
for x in range(2):
|
|
switch.turn_on(entity_id='switch.group_button_all')
|
|
switch.turn_on(entity_id='switch.group_button_all')
|
|
- task.sleep(1.0)
|
|
|
|
-
|
|
|
|
- if light.liv_room_table_lamp == 'off':
|
|
|
|
- light.turn_on(entity_id='light.liv_room_table_lamp')
|
|
|
|
task.sleep(0.5)
|
|
task.sleep(0.5)
|
|
- if light.liv_room_corner_lamp == 'off':
|
|
|
|
- light.turn_on(entity_id='light.liv_room_corner_lamp')
|
|
|
|
|
|
+ light.turn_on(entity_id='light.liv_room_table_lamp',brightness='1')
|
|
|
|
+ task.sleep(0.5)
|
|
|
|
+ light.turn_on(entity_id='light.liv_room_corner_lamp',brightness='1')
|
|
|
|
+ task.sleep(0.5)
|
|
|
|
|
|
pyscript.handle_bedroom_light()
|
|
pyscript.handle_bedroom_light()
|
|
|
|
|
|
@@ -56,6 +54,8 @@ def state_goto_window():
|
|
for x in range(2):
|
|
for x in range(2):
|
|
light.turn_off(entity_id=' light.main_button_2')
|
|
light.turn_off(entity_id=' light.main_button_2')
|
|
task.sleep(0.5)
|
|
task.sleep(0.5)
|
|
|
|
+ light.turn_off(entity_id='light.liv_room_corner_lamp')
|
|
|
|
+ task.sleep(0.5)
|
|
else: # From ALL ON
|
|
else: # From ALL ON
|
|
for x in range(2):
|
|
for x in range(2):
|
|
switch.turn_off(entity_id='switch.group_button_all')
|
|
switch.turn_off(entity_id='switch.group_button_all')
|
|
@@ -82,14 +82,14 @@ def state_goto_morning():
|
|
task.sleep(0.5)
|
|
task.sleep(0.5)
|
|
light.turn_on(entity_id=' light.main_button_2')
|
|
light.turn_on(entity_id=' light.main_button_2')
|
|
task.sleep(0.5)
|
|
task.sleep(0.5)
|
|
- if light.liv_room_corner_lamp == 'off':
|
|
|
|
- light.turn_on(entity_id='light.liv_room_corner_lamp')
|
|
|
|
|
|
+ light.turn_on(entity_id='light.liv_room_corner_lamp',brightness='1')
|
|
|
|
+ task.sleep(0.5)
|
|
elif cs == 2: # From Window
|
|
elif cs == 2: # From Window
|
|
for x in range(2):
|
|
for x in range(2):
|
|
light.turn_on(entity_id=' light.main_button_2')
|
|
light.turn_on(entity_id=' light.main_button_2')
|
|
task.sleep(0.5)
|
|
task.sleep(0.5)
|
|
- if light.liv_room_corner_lamp == 'off':
|
|
|
|
- light.turn_on(entity_id='light.liv_room_corner_lamp')
|
|
|
|
|
|
+ light.turn_on(entity_id='light.liv_room_corner_lamp',brightness='1')
|
|
|
|
+ task.sleep(0.5)
|
|
else: # From ALL ON
|
|
else: # From ALL ON
|
|
for x in range(2):
|
|
for x in range(2):
|
|
switch.turn_off(entity_id='switch.group_button_all')
|
|
switch.turn_off(entity_id='switch.group_button_all')
|
|
@@ -99,8 +99,8 @@ def state_goto_morning():
|
|
task.sleep(0.5)
|
|
task.sleep(0.5)
|
|
light.turn_on(entity_id=' light.main_button_4')
|
|
light.turn_on(entity_id=' light.main_button_4')
|
|
task.sleep(0.5)
|
|
task.sleep(0.5)
|
|
- if light.liv_room_corner_lamp == 'off':
|
|
|
|
- light.turn_on(entity_id='light.liv_room_corner_lamp')
|
|
|
|
|
|
+ light.turn_on(entity_id='light.liv_room_corner_lamp',brightness='1')
|
|
|
|
+ task.sleep(0.5)
|
|
|
|
|
|
pyscript.handle_bedroom_light()
|
|
pyscript.handle_bedroom_light()
|
|
|
|
|
|
@@ -118,6 +118,8 @@ def state_goto_all_off():
|
|
task.sleep(0.5)
|
|
task.sleep(0.5)
|
|
light.turn_off(entity_id='light.liv_room_corner_lamp')
|
|
light.turn_off(entity_id='light.liv_room_corner_lamp')
|
|
task.sleep(0.5)
|
|
task.sleep(0.5)
|
|
|
|
+ input_boolean.movie_mode = 'off'
|
|
|
|
+
|
|
|
|
|
|
@state_trigger("input_boolean.movie_mode")
|
|
@state_trigger("input_boolean.movie_mode")
|
|
def movie_mode_button_trigger():
|
|
def movie_mode_button_trigger():
|
|
@@ -125,11 +127,11 @@ def movie_mode_button_trigger():
|
|
log.info(f"********* MOVIE MODE *********** To:" + input_boolean.movie_mode + " State: " + str(cs) )
|
|
log.info(f"********* MOVIE MODE *********** To:" + input_boolean.movie_mode + " State: " + str(cs) )
|
|
if input_boolean.movie_mode == 'off' and switch.group_button_all == 'on':
|
|
if input_boolean.movie_mode == 'off' and switch.group_button_all == 'on':
|
|
log.info(f"Movie mode, turn lights ON")
|
|
log.info(f"Movie mode, turn lights ON")
|
|
- if light.liv_room_table_lamp == 'off':
|
|
|
|
- light.turn_on(entity_id='light.liv_room_table_lamp')
|
|
|
|
|
|
+ for x in range(2):
|
|
|
|
+ light.turn_on(entity_id='light.liv_room_table_lamp',brightness='1')
|
|
|
|
+ task.sleep(0.5)
|
|
|
|
+ light.turn_on(entity_id='light.liv_room_corner_lamp',brightness='1')
|
|
task.sleep(0.5)
|
|
task.sleep(0.5)
|
|
- if light.liv_room_corner_lamp == 'off':
|
|
|
|
- light.turn_on(entity_id='light.liv_room_corner_lamp')
|
|
|
|
|
|
|
|
else:
|
|
else:
|
|
log.info(f"Movie mode, turn lights OFF")
|
|
log.info(f"Movie mode, turn lights OFF")
|