on/off buttons geändert
This commit is contained in:
		@@ -67,12 +67,12 @@ def action(changePin, action):
 | 
				
			|||||||
    if action == "on":
 | 
					    if action == "on":
 | 
				
			||||||
        # Set the pin high:
 | 
					        # Set the pin high:
 | 
				
			||||||
        #GPIO.output(changePin, GPIO.HIGH)
 | 
					        #GPIO.output(changePin, GPIO.HIGH)
 | 
				
			||||||
        pi.write(changePin, 1)
 | 
					        pi.write(changePin, 0)
 | 
				
			||||||
        # Save the status message to be passed into the template:
 | 
					        # Save the status message to be passed into the template:
 | 
				
			||||||
        message = "Turned " + deviceName + " on."
 | 
					        message = "Turned " + deviceName + " on."
 | 
				
			||||||
    if action == "off":
 | 
					    if action == "off":
 | 
				
			||||||
        #GPIO.output(changePin, GPIO.LOW)
 | 
					        #GPIO.output(changePin, GPIO.LOW)
 | 
				
			||||||
        pi.write(changePin, GPIO.LOW)
 | 
					        pi.write(changePin, 1)
 | 
				
			||||||
        message = "Turned " + deviceName + " off."
 | 
					        message = "Turned " + deviceName + " off."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # For each pin, read the pin state and store it in the pins dictionary:
 | 
					    # For each pin, read the pin state and store it in the pins dictionary:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user