Add timezone selector to quiet hours in web UI - #35
Open
jampick wants to merge 1 commit into
Open
Conversation
Users can now pick an IANA timezone (e.g. America/New_York) for quiet
hours from a dropdown in the web UI rather than always using the Pi's
system timezone. Quiet hours check in watch.py respects the configured
timezone via zoneinfo; falls back to system local time when unset.
- pi/appliance.py: add quiet_tz default ("" = system timezone)
- pi/webapp/server.py: SELECTABLE_TIMEZONES list, validate quiet_tz,
pass timezones to template
- pi/webapp/templates/index.html: replace static timezone label with
a <select> dropdown
- printpulse/watch.py: _is_in_quiet_hours accepts optional tz param;
run_watch_loop accepts quiet_tz
- printpulse/app.py: add --quiet-tz CLI arg
- printpulse/pi_launcher.py: pass --quiet-tz when set in config
- tests/test_watch.py: add TestIsInQuietHoursWithTimezone
Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
America/New_York,Europe/London,Asia/Tokyo) so quiet hours work correctly regardless of what timezone the Pi is set toChanges
pi/appliance.py— addquiet_tzkey to default config (""= system timezone)pi/webapp/server.py— addSELECTABLE_TIMEZONESlist with ~40 common IANA zones; validate submittedquiet_tz; pass timezone list to templatepi/webapp/templates/index.html— replace static timezone label with a<select>dropdown populated from the serverprintpulse/watch.py—_is_in_quiet_hours()accepts optionaltz(IANA string) and useszoneinfo.ZoneInfo;run_watch_loop()acceptsquiet_tzprintpulse/app.py— add--quiet-tzCLI argprintpulse/pi_launcher.py— pass--quiet-tzto watch loop when set in configtests/test_watch.py— addTestIsInQuietHoursWithTimezonecovering explicit TZ and invalid TZ fallbackTest plan
python -m pytest tests/ -v -s— all tests passAmerica/New_York), save — confirm the watcher log shows the chosen TZ in the quiet hours label🤖 Generated with Claude Code