Add web admin panel and centralize config - #3
Open
SyButter wants to merge 5 commits into
Open
Conversation
- Add webadmin/ Flask app: password-protected UI to edit location/method, volumes, Friday Surah, upload/manage adhans, control the random pool, preview audio, test playback, and reinstall cron. - Add adhan_config.py as the single source of truth for settings.ini and the adhans.json random pool; mirror location/method to the display. - Add play_adhan.py: cron now resolves the random adhan + volume at play time, so volume/pool edits apply on the next prayer without rescheduling. Fixes volumes never being applied (mpv --volume was hardcoded to 100). - Wire adhan-display/script.js to read display_config.json instead of hardcoded coordinates, keeping the wall display and speaker schedule in sync. - Document the admin panel in README; ignore local config artifacts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Installs Flask + mpv, creates and enables systemd services for the admin panel (:8080) and wall display (:8000) with Restart=always, refreshes the adhan cron jobs, and optionally configures the kiosk browser autostart (--with-kiosk). Paths and run-user are auto-detected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New POST /api/stop endpoint runs pkill for play_adhan.py and mpv to cut off any adhan/dua currently playing (e.g. overlapping test playbacks), with a matching danger-styled button in the Test on speakers section. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New "Prayer playback" section lets you mute the adhan for individual prayers (e.g. Fajr/Dhuhr after a night shift) while their times still show on the display. Cron now schedules each prayer by name so play_adhan.py checks the [PRAYERS] toggle at play time and skips muted ones — no reschedule needed. Also makes the adhan library rows wrap cleanly on mobile. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New [CALC] settings let you override the Fajr/Isha twilight angles (blank = method default) and choose Standard vs Hanafi (later) Asr. Applied via PrayTimes.adjust() in both updateAzaanTimers.py and the display's script.js, mirrored through display_config.json so audio and display stay in sync. Also removes the display's hardcoded fajr=18 override that ignored the method. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
A password-protected management website (
webadmin/, Flask) to run on the Pi, plus a refactor so location/volume/pool config lives in one place.Admin panel features
settings.iniand mirrors to the wall displayUnder the hood
adhan_config.py— single source of truth forsettings.ini+adhans.jsonplay_adhan.py— cron calls this at prayer time; it picks the random adhan and applies volume, so pool/volume edits apply on the next prayer with no reschedulempv --volumewas hardcoded to100and volume settings did nothingscript.jsnow readsdisplay_config.json, so the display and speakers no longer use conflicting coordinatesNotes
settings.ini,adhans.json,display_config.json) stay gitignoredsettings.ini[ADMIN](defaults toadmin/adhanuntil set on the device)🤖 Generated with Claude Code