axyd icon

ff 20181102

axyd | PRO | 11/03/18 01:35:26 AM UTC | 0 ⭐ | 742 👁️ | Never ⏰ | []
Python |

920 B

|

None

|

0 👍

/

0 👎

import array
 
ctr = 0
boolSwitch = [0,0,0,0]
strSwitch = []
 
strSwitch.append(parser.get('Switches', 'Switch1'))
strSwitch.append(parser.get('Switches', 'Switch2'))
strSwitch.append(parser.get('Switches', 'Switch3'))
strSwitch.append(parser.get('Switches', 'Switch4'))
 
 
 
for val in strSwitch:
    //check for off in switches
    if (val == 'off'):
        boolSwitch[ctr] = 0    
    //check for Day in switches
    elif ((day < timenow < night) && val = 'Day'):
        switch_on(ctr + 1)
        boolSwitch[ctr] = 1  
            
        i = dayHigh #day time temp    
    //failed Day check, night
    elif (val == 'Day'):
        switch_off(ctr + 1)
        boolSwitch = 0
    
    
    //check for temperature
    if ((temp2 < i) && val == 'Heat'):  
        switch_on(ctr + 1)
        boolSwitch[ctr] = 1
    //higher temp    
    elif (val == 'heat'):
        switch_off(1)
        boolSwitch = 0
    
    //check the next switch 
    ctr++

Comments