Advertisement
axyd

ff 20181102

Nov 2nd, 2018
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.92 KB | None | 0 0
  1. import array
  2.  
  3. ctr = 0
  4. boolSwitch = [0,0,0,0]
  5. strSwitch = []
  6.  
  7. strSwitch.append(parser.get('Switches', 'Switch1'))
  8. strSwitch.append(parser.get('Switches', 'Switch2'))
  9. strSwitch.append(parser.get('Switches', 'Switch3'))
  10. strSwitch.append(parser.get('Switches', 'Switch4'))
  11.  
  12.  
  13.  
  14. for val in strSwitch:
  15.     //check for off in switches
  16.     if (val == 'off'):
  17.         boolSwitch[ctr] = 0    
  18.     //check for Day in switches
  19.     elif ((day < timenow < night) && val = 'Day'):
  20.         switch_on(ctr + 1)
  21.         boolSwitch[ctr] = 1  
  22.            
  23.         i = dayHigh #day time temp    
  24.     //failed Day check, night
  25.     elif (val == 'Day'):
  26.         switch_off(ctr + 1)
  27.         boolSwitch = 0
  28.    
  29.    
  30.     //check for temperature
  31.     if ((temp2 < i) && val == 'Heat')
  32.         switch_on(ctr + 1)
  33.         boolSwitch[ctr] = 1
  34.     //higher temp    
  35.     elif (val == 'heat'):
  36.         switch_off(1)
  37.         boolSwitch = 0
  38.    
  39.     //check the next switch
  40.     ctr++
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement