use correct timezone
This commit is contained in:
@@ -44,7 +44,7 @@ Das IdentityFile ist der Deploy-SSH-Key, der im [Repo](https://git.chaospott.de/
|
||||
### Schlüsselupdate
|
||||
|
||||
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
|
||||
Bit entsprechen, werden ignoriert.
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
Package: foodoord
|
||||
Version: 3.3.3
|
||||
Version: 3.4.0
|
||||
Maintainer: Tobi <tobi@chaospott.de>
|
||||
Architecture: all
|
||||
Description: Control the doors of the club, ja!
|
||||
|
||||
Vendored
+9
-4
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim: ts=2 sw=2 et
|
||||
|
||||
import datetime
|
||||
import grp
|
||||
import json
|
||||
import os
|
||||
@@ -12,7 +13,7 @@ import threading
|
||||
import time
|
||||
from configparser import ConfigParser
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
import paho.mqtt.client as mqtt
|
||||
import pifacedigitalio
|
||||
@@ -148,9 +149,13 @@ class Foodoord:
|
||||
self.pifacedigital.leds[gpio].turn_off()
|
||||
|
||||
def doorbell(self, event):
|
||||
day = datetime.now().weekday()
|
||||
# NOTE: Monday is 0; do not unlock on Wednesday
|
||||
if self.status_open and day != 2:
|
||||
# ignore doorbell button on Wednesdays
|
||||
now = datetime.datetime.now(ZoneInfo("Europe/Berlin"))
|
||||
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()
|
||||
time.sleep(2)
|
||||
self.pifacedigital.relays[self.RELAYS_UNLOCK].toggle()
|
||||
|
||||
Reference in New Issue
Block a user