Update relay GPIO write method to use integer values and display last button press time on LCD

This commit is contained in:
Aaro Varis
2026-01-15 10:45:17 +02:00
parent fb134bc25a
commit 7d2435bbe9

View File

@@ -49,7 +49,7 @@ class AlarmClock:
print(f"Button '{button}' pressed state: {state}") print(f"Button '{button}' pressed state: {state}")
if button == "button": if button == "button":
self.lastButtonPressTime = time() self.lastButtonPressTime = time()
self.relayGpio.write(GPIO.HIGH if state else GPIO.LOW) self.relayGpio.write(1 if state else 0)
self.setLcdText(self.lastButtonPressTime.__str__()) self.setLcdText(self.lastButtonPressTime.__str__())
def setLcdText(self, text: str): def setLcdText(self, text: str):