feat: make MIMI_TIMEZONE configurable via mimi_secrets.h - #179
feat: make MIMI_TIMEZONE configurable via mimi_secrets.h#179joaosouz4dev wants to merge 2 commits into
Conversation
Today the timezone is hard-coded to US Pacific in mimi_config.h, which means every local timestamp emitted by the firmware (session logs, agent context, tool output, etc.) is wrong for any user outside the US west coast. Changing it requires editing a tracked file and is easy to forget when pulling upstream. This patch adds MIMI_SECRET_TIMEZONE alongside the other build-time secrets so it can be set per-device in mimi_secrets.h (which is gitignored). MIMI_TIMEZONE is redefined to MIMI_SECRET_TIMEZONE and the secret defaults to "PST8PDT,M3.2.0,M11.1.0" — identical to the prior value, so existing setups behave exactly the same. main/mimi_config.h secret fallback + alias main/mimi_secrets.h.example documented secret with regional samples README.md pointer to the new knob
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds a new timezone configuration mechanism that enables per-device customization via secrets. The changes introduce ChangesTimezone configuration override
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Today
MIMI_TIMEZONEis hard-coded to US Pacific (PST8PDT,M3.2.0,M11.1.0) inmimi_config.h. Every local timestamp emitted by the firmware — session log filenames, agent context, tool output, the existingget_current_timetool,localtime_r()calls throughout — is therefore wrong by anywhere between 4 and 16 hours for users outside the US west coast. Fixing it requires editing a git-tracked file, which is easy to forget when pulling upstream and noisy in PR diffs.This patch promotes the value to the existing build-time secrets layer:
Set
MIMI_SECRET_TIMEZONEinmimi_secrets.h(gitignored, per-device) and you're done. Leave it unset and the default keeps the prior US Pacific value, so no existing build behaves differently.What's in the diff
main/mimi_config.h—MIMI_SECRET_TIMEZONEwith#ifndeffallback (same pattern as every other secret in the file) andMIMI_TIMEZONEaliased to it.main/mimi_secrets.h.example— documentedMIMI_SECRET_TIMEZONEslot with worked POSIX TZ examples for Brasília, Lisbon, London, Berlin, Tokyo, New York, plus a link totzset(3).README.md— one-paragraph pointer in the "Configure" section.No code-path changes: every caller already includes
mimi_config.hand readsMIMI_TIMEZONE, so the substitution is transparent.Test plan
mimi_secrets.hoverride):idf.py fullclean && idf.py buildsucceeds,MIMI_TIMEZONEstill expands to"PST8PDT,M3.2.0,M11.1.0".MIMI_SECRET_TIMEZONE "<-03>3"inmimi_secrets.h, rebuild, flash, and confirmlocaltime_r()output (e.g. viaget_current_timetool or any session log) matches local wall-clock time in São Paulo.Summary by CodeRabbit
Release Notes
New Features
Documentation