a
This commit is contained in:
2
init.py
2
init.py
@@ -50,7 +50,7 @@ class AlarmClock:
|
|||||||
|
|
||||||
def onButtonPress(self, button: str, state: bool):
|
def onButtonPress(self, button: str, state: bool):
|
||||||
print(f"Button '{button}' pressed state: {state}")
|
print(f"Button '{button}' pressed state: {state}")
|
||||||
if button == "button":
|
if button == "button" and state == True:
|
||||||
self.lastButtonPressTime = time()
|
self.lastButtonPressTime = time()
|
||||||
self.setRelayState(not self.relayGpio.read())
|
self.setRelayState(not self.relayGpio.read())
|
||||||
self.setLcdText(self.lastButtonPressTime.__str__())
|
self.setLcdText(self.lastButtonPressTime.__str__())
|
||||||
|
|||||||
Reference in New Issue
Block a user