use correct timezone

This commit is contained in:
T
2026-06-13 14:08:00 +02:00
parent 23e126a08b
commit 9aa480a348
3 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ Das IdentityFile ist der Deploy-SSH-Key, der im [Repo](https://git.chaospott.de/
### Schlüsselupdate ### Schlüsselupdate
Das Script [`foodoor-update-keydb`](debian/usr/sbin/foodoor-update-keydb) Das Script [`foodoor-update-keydb`](debian/usr/sbin/foodoor-update-keydb)
aktualisiert regelmäßig die Schlüssel auf der Tür und baut die `Authorized_Keys` aktualisiert regelmäßig die Schlüssel auf der Tür und baut die `authorized_keys`
für die Benutzer `open` und `close`. Keys, die nicht dem OpenSSH-Format mit 4096 für die Benutzer `open` und `close`. Keys, die nicht dem OpenSSH-Format mit 4096
Bit entsprechen, werden ignoriert. Bit entsprechen, werden ignoriert.
+1 -1
View File
@@ -1,5 +1,5 @@
Package: foodoord Package: foodoord
Version: 3.3.3 Version: 3.4.0
Maintainer: Tobi <tobi@chaospott.de> Maintainer: Tobi <tobi@chaospott.de>
Architecture: all Architecture: all
Description: Control the doors of the club, ja! Description: Control the doors of the club, ja!
+9 -4
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# vim: ts=2 sw=2 et # vim: ts=2 sw=2 et
import datetime
import grp import grp
import json import json
import os import os
@@ -12,7 +13,7 @@ import threading
import time import time
from configparser import ConfigParser from configparser import ConfigParser
from dataclasses import dataclass from dataclasses import dataclass
from datetime import datetime from zoneinfo import ZoneInfo
import paho.mqtt.client as mqtt import paho.mqtt.client as mqtt
import pifacedigitalio import pifacedigitalio
@@ -148,9 +149,13 @@ class Foodoord:
self.pifacedigital.leds[gpio].turn_off() self.pifacedigital.leds[gpio].turn_off()
def doorbell(self, event): def doorbell(self, event):
day = datetime.now().weekday() # ignore doorbell button on Wednesdays
# NOTE: Monday is 0; do not unlock on Wednesday now = datetime.datetime.now(ZoneInfo("Europe/Berlin"))
if self.status_open and day != 2: if ((now.isoweekday() == 3 and now.time() >= datetime.time(14))
or (now.isoweekday() == 4 and now.time() < datetime.time(2))):
return
if self.status_open:
self.pifacedigital.relays[self.RELAYS_UNLOCK].toggle() self.pifacedigital.relays[self.RELAYS_UNLOCK].toggle()
time.sleep(2) time.sleep(2)
self.pifacedigital.relays[self.RELAYS_UNLOCK].toggle() self.pifacedigital.relays[self.RELAYS_UNLOCK].toggle()