فهرست منبع

Moving logs. Gitignore ._ yaml files

pi 4 سال پیش
والد
کامیت
5c8a564949
2فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 1 0
      .gitignore
  2. 6 4
      pyscript/home_automations.py

+ 1 - 0
.gitignore

@@ -27,6 +27,7 @@ known_devices.yaml
 *.db
 *.db
 *.uuid
 *.uuid
 .HA_VERSION
 .HA_VERSION
+._*.yaml
 
 
 # Node-Red
 # Node-Red
 node-red
 node-red

+ 6 - 4
pyscript/home_automations.py

@@ -5,18 +5,20 @@ state.persist('pyscript.home_auto_lights_off_has_been_night','false')
 
 
 @state_trigger("int(sensor.lux_outside_the_garage) > int(float(input_number.auto_light_off_lux_value))", state_hold_false=0)
 @state_trigger("int(sensor.lux_outside_the_garage) > int(float(input_number.auto_light_off_lux_value))", state_hold_false=0)
 def automate_home_auto_lights_off():
 def automate_home_auto_lights_off():
-    log.info(f"********* AUTO LIGHTS OFF *********** Lux: " + str(sensor.lux_outside_the_garage) )
     if( pyscript.home_auto_lights_off_has_been_night == 'true' ):
     if( pyscript.home_auto_lights_off_has_been_night == 'true' ):
+
+        log.info(f"********* AUTO LIGHTS OFF *********** Lux: " + str(sensor.lux_outside_the_garage) + " Limit:"+str(input_number.auto_light_off_lux_value))
+
         pyscript.home_auto_lights_off_has_been_night = 'false'
         pyscript.home_auto_lights_off_has_been_night = 'false'
         
         
         if input_boolean.auto_lights_off == 'on':
         if input_boolean.auto_lights_off == 'on':
-        	pyscript.state_goto_all_off();
+        	pyscript.state_goto_all_off()
 
 
 
 
 # Activate morning lights when Thomas gets up
 # Activate morning lights when Thomas gets up
 @time_trigger("once(06:18:00)")
 @time_trigger("once(06:18:00)")
 def morning_lights_thomas():
 def morning_lights_thomas():
-    log.info(f"********* THOMAS MORNING ON ***********")
     if binary_sensor.workday_sensor == 'on':
     if binary_sensor.workday_sensor == 'on':
         if switch.eng_heat_a == 'on' or switch.eng_heat_b == 'on':
         if switch.eng_heat_a == 'on' or switch.eng_heat_b == 'on':
-            pyscript.state_goto_morning();
+            log.info(f"********* THOMAS MORNING ON ***********")
+            pyscript.state_goto_morning()