Commit Graph
63 Commits
Author SHA1 Message Date
christianandClaude Opus 5 b02e6702e4 fix: Stamm-Besetzer der Zentrale kommt bei Freigabe zurueck
"Zurueck auf mein Tuerschild" hat die Zentrale nur ausgeschaltet, statt
ihren eigentlichen Besetzer wieder darauf zu setzen. Wer normalerweise am
Empfang sitzt, blieb nach einer Vertretung ohne Zuordnung.

Die Zentrale hat jetzt einen Stamm-Besetzer, ohne dass es dafuer eine
eigene Einstellung braucht: wer beim ersten Verdraengen keinen anderen
Platz gemerkt hat, bekommt das Zentral-Segment als Heimatplatz vermerkt.
Wird die Zentrale wieder frei, kommt er automatisch zurueck - egal wie
viele Vertretungen sich zwischenzeitlich abgewechselt haben.

Der Vermerk des Stamm-Besetzers bleibt dabei dauerhaft stehen, anders als
bei einer Vertretung: die Zentrale ist sein normaler Platz, nicht eine
Station, aus der er zurueckkehrt. Klickt er selbst "zurueck auf mein
Tuerschild", aendert sich deshalb nichts und die Seite erklaert es.

Damit gilt in beide Richtungen dieselbe Regel: wird ein Platz frei, kommt
zurueck, fuer wen er gemerkt ist.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 08:47:21 +00:00
christianandClaude Opus 5 11c8042de0 fix: Vorgaenger bei Uebernahme der Zentrale zurueckstellen
Bisher blieb der bisherige Besetzer der Zentrale nach einer Uebernahme
ohne Zuordnung. In der Praxis heisst das: er hat gar kein Licht mehr, und
es musste immer erst jemand "zurueck auf mein Tuerschild" klicken, damit
der Zustand wieder stimmte.

Die Uebernahme setzt den Vorgaenger jetzt selbst auf seinen gemerkten
Heimatplatz zurueck. Ist der inzwischen jemand anderem zugeordnet oder
war keiner gemerkt, bleibt er ohne Zuordnung - die Meldung auf der Seite
nennt den jeweiligen Grund.

Dabei darf das eben freigegebene Segment des neuen Besetzers nicht
ausgeschaltet werden, wenn der Vorgaenger genau dorthin zurueckkehrt -
sonst waere sein Licht sofort wieder aus.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 08:37:26 +00:00
christianandClaude Opus 5 086b21dc2b feat: Zentrale per Durchwahl selbst besetzen
Das Busylight im Empfangsbereich wird wechselnd besetzt. Mitarbeiter
koennen sich jetzt selbst darauf setzen, ohne Admin-Passwort.

- Neue Seite /zentrale (Durchwahl eingeben) und /zentrale/{durchwahl}
  als Direktlink fuer QR-Codes. Der Direktlink zeigt nur an und aendert
  nichts, damit Link-Vorschau und Prefetch niemanden versetzen.
- Neue Tabelle home_assignments merkt das eigene Tuerschild, solange der
  Mitarbeiter in der Zentrale sitzt. Beim Verlassen wird es
  wiederhergestellt, das Zentral-Segment wird freigegeben.
- Der Vorgaenger bleibt ohne Zuordnung - er ist nicht da. Sein gemerkter
  Heimatplatz bleibt erhalten, er kann jederzeit zurueckkehren.
- Ist der Heimatplatz inzwischen belegt, wird die Rueckkehr abgelehnt
  und nichts geaendert.
- Eine ausdrueckliche Admin-Zuordnung verwirft den gemerkten Heimatplatz.
  Ein reines Loeschen der Zuordnung nicht, sonst kaeme niemand mehr von
  der Zentrale zurueck.
- Farbe wird sofort ans Geraet geschickt (scheduler.push_user_light).
  Das Polling allein reicht nicht: _process_user sendet nur bei einer
  Statusaenderung, und beim Platzwechsel bleibt der Status gleich.
- Neue Settings selfservice_device_id und selfservice_segment,
  einstellbar unter Einstellungen.
- Jeder Wechsel landet im Protokoll (zentrale / zentrale_frei).

Die Durchwahl ist eine Kennung, kein Geheimnis - im README dokumentiert.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 08:12:42 +00:00
christianandClaude Opus 4.6 65314f2338 fix: FX=0 nach Segment-Auswahl senden
FX=0 muss nach SS= kommen, damit nur das gewaehlte Segment
zurueckgesetzt wird und nicht beide.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 23:32:54 +02:00
christianandClaude Opus 4.6 92f333a533 fix: WLED-Effekt bei callend zuruecksetzen (FX=0)
Wenn bei callstart ein Effekt gesetzt wird (z.B. FX=9), wurde dieser
beim callend nicht aufgehoben. Jetzt wird FX=0 (Solid) explizit
gesendet wenn kein Effekt konfiguriert ist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 23:30:15 +02:00
christianandClaude Opus 4.6 6e6edd91db docs: README komplett ueberarbeitet - AIDA entfernt, modular
- Alle AIDA-Referenzen durch "Zeiterfassung" ersetzt
- Modulare Zeiterfassung dokumentiert (CSV + REST API)
- Azure-Einrichtung auf Webbasierte Auth aktualisiert
- Verweis auf detaillierte Azure-Anleitung
- Projektstruktur und Installer ergaenzt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 11:50:55 +02:00
christianandClaude Opus 4.6 6b316fc9da docs: README auf neues Repo und Installer aktualisieren
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 11:48:02 +02:00
christianandClaude Opus 4.6 1786cf730c feat: Installer-Script fuer Debian 13
Einzeiler-Installation:
curl -s https://git.cynfo.net/christian/busylight_modular/raw/branch/master/install.sh | bash

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 11:43:06 +02:00
christianandClaude Opus 4.6 0d080ff885 refactor: AIDA -> modulare Zeiterfassung
- Alle AIDA-Referenzen durch generische Begriffe ersetzt
  (aida -> attendance im Code, "Zeiterfassung" im UI)
- DB-Spalten: last_aida_status -> last_attendance_status
- Settings: aida_csv_path -> attendance_csv_path
- REST API fuer Zeiterfassung auf Port 8081:
  POST /api/attendance/{personal_nr} mit {"status": "anwesend"}
  GET  /api/attendance - alle Status abfragen
- Automatische DB-Migration fuer bestehende Installationen
- CSV bleibt als Option, API als Echtzeit-Alternative

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 10:28:45 +02:00
christianandClaude Opus 4.6 12aa2d7ea1 fix: neutralen Placeholder fuer WLED-Hostname
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 10:19:45 +02:00
christianandClaude Opus 4.6 bae07e78e7 feat: webbasierte Azure-Authentifizierung
Device-Code-Flow direkt ueber das Web-Interface starten statt
ueber die Kommandozeile. Button "Mit Azure verbinden" in den
Einstellungen zeigt Code und Link an, pollt den Status und
laedt die Seite nach Erfolg neu.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 10:03:04 +02:00
christianandClaude Opus 4.6 d5d5160257 ui: Azure-Felder an Azure-Portal-Bezeichnungen anpassen
- "Client ID" -> "Anwendungs-ID (Client)"
- "Tenant ID" -> "Verzeichnis-ID (Mandant)"
- "Auth Tenant" und "Client Secret" ausgeblendet (nicht noetig)
- Hilfstexte mit Azure-Portal-Pfaden hinzugefuegt
- Auth Tenant wird automatisch aus Tenant ID gesetzt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 09:32:00 +02:00
christianandClaude Opus 4.6 7b8b01917f docs: Azure Entra ID Einrichtungsanleitung fuer Onboarding
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 09:18:41 +02:00
christianandClaude Opus 4.6 44befa9eb1 ui: replace logo in login page
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 09:10:18 +02:00
christianandClaude Opus 4.6 5b330f6f2b ui: replace logo with cynfo PNG
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 09:08:26 +02:00
christian b336bf3573 docs: rewrite Starface module guide as step-by-step new build 2026-04-24 23:03:29 +02:00
christian f89b9b4626 docs: detailed Starface module rebuild guide using HttpRequest 2026-04-24 17:14:29 +02:00
christianandClaude Opus 4.6 1e66646f52 docs: add Starface Modulcreator guide and webhook test script
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 17:03:29 +02:00
christian 6eab41db92 fix: white logo text for dark sidebar, dark variant for login page 2026-04-24 14:24:59 +02:00
christian 066844f2ac fix: show logo in original colors 2026-04-24 14:23:04 +02:00
christianandClaude Opus 4.6 07b586924d ui: replace text header with logo.svg, add copyright footer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 14:21:45 +02:00
christian cddea5ba4c ui: back to table layout with segment assignments inline 2026-04-24 14:14:32 +02:00
christian ed34ea95ca ui: move add device + firmware to top of Tuerschilder page 2026-04-24 14:05:29 +02:00
christianandClaude Opus 4.6 10d90a3739 ui: redesign Tuerschilder page as card grid with all device info
- Card per device showing: hostname, MAC, version, LEDs, segments
- Segment assignments displayed per card
- Last activity timestamp
- Online/offline dot in card header
- Action buttons in card footer
- Add device + firmware upload side by side at bottom

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 14:02:24 +02:00
christian 14b6352d7e revert: restore original dashboard with icons and full labels 2026-04-24 13:50:11 +02:00
christianandClaude Opus 4.6 8a578fbe8d feat: compact dashboard + login system for admin pages
Dashboard:
- Much smaller cards (col-xl-2), compact badges
- Short labels (Buero, HO, DND, OoO, etc.)
- Optimized for small screens

Login:
- Password-protected admin pages (all except dashboard)
- Dashboard remains public (read-only status view)
- Login page with redirect back to requested page
- Session cookie (24h, regenerated on restart)
- Password set via Settings page (SHA256 hashed)
- Sidebar shows only Dashboard when not logged in
- Login/Logout link in sidebar footer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 13:48:58 +02:00
christian 5294e8ef50 fix: keep MAC, version, LEDs in DB when device goes offline 2026-04-24 13:35:41 +02:00
christian 02ab0d0139 fix: only show OTA button when firmware differs from current version 2026-04-24 13:17:06 +02:00
christianandClaude Opus 4.6 9218d10540 feat: OTA firmware update per device with auto config backup
- Upload .bin firmware files via web UI
- Update individual devices (button per device in table)
- Auto config backup before each update
- Shows current version vs available firmware
- Firmware file management (upload/delete)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 13:08:38 +02:00
christian 0d6c03049c fix: replace loop.parent with filename-based modal IDs (Jinja2 compat) 2026-04-24 13:02:59 +02:00
christian 28cb191956 fix: WLED auto-backup monthly instead of daily 2026-04-24 13:02:15 +02:00
christianandClaude Opus 4.6 1f674b132c feat: auto WLED backup at 02:05, grouped by device with collapsible view
- Auto WLED config backup daily at 02:05 (keeps last 14 per device)
- Backup page: WLED configs grouped by hostname in accordion
- Each device shows backup count and last backup date
- Collapsible sections to keep page compact
- Readable date format (dd.mm.yyyy HH:MM:SS) for all backups
- Scrollable containers for long lists

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 13:01:28 +02:00
christianandClaude Opus 4.6 06253e3fef feat: backup system for portal DB and WLED configs
Portal DB:
- Download current DB button
- Manual backup creation
- Auto-backup daily at 02:00 (keeps last 14)
- Download/delete individual backups

WLED Config:
- Backup all devices at once
- Backup individual device
- Download config as JSON
- Restore config to any device
- Delete old backups

New sidebar menu item 'Backup' with dedicated page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 12:55:06 +02:00
christianandClaude Opus 4.6 4b6c20e638 fix: use local time for activity_log timestamps instead of UTC
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 12:35:27 +02:00
christianandClaude Opus 4.6 13b2e452da fix: add 10s timeout to SQLite connections to prevent database locked errors
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 12:26:19 +02:00
christianandClaude Opus 4.6 9716dfd9bb feat: show WLED MAC address on Tuerschilder page
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 11:36:45 +02:00
christianandClaude Opus 4.6 77ae7b357d feat: show last activity timestamp per device on Tuerschilder page
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 11:28:33 +02:00
christianandClaude Opus 4.6 ae6feacf6a fix: remove oben/unten labels from segment dropdowns
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 00:19:02 +02:00
christianandClaude Opus 4.6 99e85cd649 fix: NameError in callend webhook (undefined 'teams' variable)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 00:14:31 +02:00
christianandClaude Opus 4.6 39561fe438 ui: rebrand to cynfo GmbH, rename WLED-Geraete to Tuerschilder
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 23:53:01 +02:00
christianandClaude Opus 4.6 327edf4f16 fix: non-blocking initial device check to prevent startup hang
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 23:49:13 +02:00
christianandClaude Opus 4.6 3329a5dc5a docs: complete README rewrite with webhook, segments, CSV format, troubleshooting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 23:45:17 +02:00
christianandClaude Opus 4.6 844f5b1fdb fix: correct segment order (0=unten, 1=oben) in dashboard and assignments
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 23:42:31 +02:00
christianandClaude Opus 4.6 69fa30f79c fix: callend restores AIDA color, not Teams (Teams comes via polling)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 23:23:57 +02:00
christianandClaude Opus 4.6 73f25c4c7e feat: webhook info page on / and always show phone status in dashboard
- GET / on port 8081 shows API usage info instead of 404
- Dashboard always shows phone badge (Telefoniert/Frei) alongside AIDA and Teams

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 23:22:02 +02:00
christianandClaude Opus 4.6 7f2858aab6 feat: phone webhook integration (callstart/callend on port 8081)
- New webhook server on port 8081 for phone system (PBX)
- Endpoints: GET/POST /{extension}/callstart and /{extension}/callend
- New 'phone_extension' field on users (Durchwahl)
- Only activates when user is anwesend or homeoffice (AIDA)
- Sets WLED to phone_active color (red) on callstart
- Restores previous Teams/AIDA color on callend
- Polling skips WLED update while phone is active
- Dashboard shows phone badge when user is in a call
- New color rule 'phone_active' (configurable via web UI)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 23:15:51 +02:00
christianandClaude Opus 4.6 47210cb068 feat: add per-device check button on WLED devices page
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 23:06:39 +02:00
christianandClaude Opus 4.6 e88ab3ab08 feat: background device status check every 240s instead of on page load
- Add online, leds, version, last_check columns to wled_devices table
- Background job checks all WLED devices every 4 minutes
- Initial check on startup
- Devices page reads status from DB (instant page load)
- 'Alle jetzt pruefen' button triggers manual check

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 23:03:12 +02:00
christianandClaude Opus 4.6 a7efb12d5c fix: robust AIDA CSV parsing (handle ~~ vs ~ prefix, comma separator)
CSV format is '~~00341~~,~~0~~' or '~00341~~,~~0~~'.
Strip tildes and compare bare numbers instead of relying on
startswith/endswith which breaks with inconsistent tilde counts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 22:51:56 +02:00
christianandClaude Opus 4.6 5e9af4e268 feat: show AIDA + Teams status badges in dashboard, keep original WLED logic
- WLED only controlled when AIDA status is known (original behavior:
  abwesend->off, homeoffice->yellow, anwesend->Teams color)
- Teams presence always queried and stored for dashboard display
- Dashboard shows colored badges for both AIDA and Teams status
- Works without AIDA CSV (Teams status still visible in dashboard)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 22:23:22 +02:00
christianandClaude Opus 4.6 8d178eac6d feat: poll Teams presence independently of AIDA CSV
- Teams status is now always queried, even without AIDA CSV
- Users without personal_nr are also polled (Teams-only mode)
- If AIDA is unavailable, default to 'anwesend' and use Teams color
- Dashboard will now show Teams status even without SMB mount

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 22:14:43 +02:00
christianandClaude Opus 4.6 ce19dec8c1 docs: rewrite README with Azure setup guide and troubleshooting
Also improve dashboard to show 'Warte auf Status...' instead of
gray bars when user is assigned but no polling result exists yet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 22:11:57 +02:00
christianandClaude Opus 4.6 4e659000f7 fix: pass authenticated status to all pages via _ctx helper
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 21:58:27 +02:00
christianandClaude Opus 4.6 1bf42250b4 feat: add WLED device status check (online/offline, LEDs, version)
- Query WLED JSON API (/json/info) for device info
- Show online/offline status dot, LED count and firmware version
- Auto-check all devices on page load
- Button to manually check individual or all devices
- Fix hostname placeholder to volksheimstaette.de

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 21:57:07 +02:00
christianandClaude Opus 4.6 bc96fed884 fix: correct TemplateResponse arg order (request, name, context)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 21:48:24 +02:00
christianandClaude Opus 4.6 2f553295cb fix: TemplateResponse for Starlette 1.0 (request as keyword arg)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 21:46:39 +02:00
christianandClaude Opus 4.6 6f52c43aca fix: use keyword args for TemplateResponse (Starlette 0.40+ compat)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 21:45:13 +02:00
christianandClaude Opus 4.6 40c9607598 fix: clear old auth record before device code flow to force fresh login
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 21:22:03 +02:00
christianandClaude Opus 4.6 dd9e2f4acd fix: use allow_unencrypted_storage for headless Linux token cache
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 21:15:16 +02:00
christianandClaude Opus 4.6 3ddb3ce8c4 fix: pin msgraph-core to <1.0.0 (v1.x broke GraphClient API)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 21:13:21 +02:00
christianandClaude Opus 4.6 63d8ee3e99 fix: use cp1252 encoding for config.cfg (Windows umlauts)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 21:11:19 +02:00
christianandClaude Opus 4.6 a41849ff7d docs: add README with installation and usage instructions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 20:49:59 +02:00
christianandClaude Opus 4.6 5267baf0b4 feat: rewrite busylight as FastAPI web application with SQLite
Replace the standalone Python script + config.cfg with a full web
application featuring:
- FastAPI backend with REST API
- SQLite database (config, state, activity log separated)
- Bootstrap 5 web interface for configuration
- Pages: Dashboard, Users, Devices, Assignments, Color Rules, Settings, Log
- APScheduler background polling for Teams presence + AIDA status
- systemd service file for Linux deployment
- Migration script to import existing config.cfg data

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 20:46:33 +02:00