Skip to content

feat(community): add prayer-times ability#216

Closed
mahsumaktas wants to merge 2 commits intoopenhome-dev:devfrom
mahsumaktas:community/prayer-times
Closed

feat(community): add prayer-times ability#216
mahsumaktas wants to merge 2 commits intoopenhome-dev:devfrom
mahsumaktas:community/prayer-times

Conversation

@mahsumaktas
Copy link
Copy Markdown
Contributor

Summary

Voice-activated Islamic prayer times assistant with automatic background reminders.

  • Skill: "When is the next prayer?", "What are today's prayer times?", specific prayer queries, location setup, calculation method selection
  • Background Daemon: 5-minute advance reminder before each prayer + notification at prayer time
  • API: Aladhan Prayer Times API — free, no API key required
  • Calculation methods: ISNA, MWL, Diyanet (Turkey), Karachi, Makkah, Egypt

Why This Ability

  • Zero competition in the community — no existing prayer/religious time ability
  • 2B+ potential users worldwide
  • Skill + Daemon combo showcasing OpenHome's newest background ability feature
  • Fully location-aware with daily auto-refresh

Technical Highlights

  • Memory-cached timings in background daemon (parses once/day, not every loop)
  • API failure backoff (avoids hammering on outage)
  • Config file re-read every ~5 min to pick up user changes
  • Delete-before-write file pattern (matches Alarm template)
  • LLM-based intent parsing for natural voice commands
  • Prayer name normalization (handles case variations from LLM)

Files

File Purpose
main.py Skill — voice command handling
background.py Daemon — automatic prayer reminders
README.md Documentation + setup guide
__init__.py Package init

Suggested Trigger Words

prayer times, next prayer, when is fajr, when is dhuhr,
when is asr, when is maghrib, when is isha, salah time,
namaz vakti, prayer schedule

Test Plan

  • First-time setup: triggers location prompt, saves config
  • "When is the next prayer?" — returns correct upcoming prayer
  • "What are today's prayer times?" — lists all 6 times
  • "When is Fajr?" — returns specific prayer time
  • Background daemon sends reminder ~5 min before prayer
  • Background daemon sends notification at prayer time
  • Day rollover: resets reminders, fetches fresh times
  • API failure: graceful error message, backoff retry

🤖 Generated with Claude Code

Skill + Background Daemon combo for Islamic prayer times:
- Voice queries: next prayer, all times, specific prayer lookup
- Background reminders: 5-min advance + adhan notification
- Location-based via Aladhan API (free, no key required)
- Multiple calculation methods (ISNA, MWL, Diyanet, etc.)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mahsumaktas mahsumaktas requested a review from a team as a code owner March 16, 2026 18:14
@github-actions
Copy link
Copy Markdown
Contributor

✅ Community PR Path Check — Passed

All changed files are inside the community/ folder. Looks good!

@github-actions
Copy link
Copy Markdown
Contributor

🔀 Branch Merge Check

PR direction: community/prayer-timesdev

Passedcommunity/prayer-timesdev is a valid merge direction

@github-actions github-actions bot added the community-ability Community-contributed ability label Mar 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ Ability Validation Passed

📋 Validating: community/prayer-times
  ✅ All checks passed!

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lint Results

🔧 Auto-formatted

Some files were automatically cleaned and formatted with autoflake + autopep8 and committed.

  • Unused imports removed (autoflake)
  • Unused variables removed (autoflake)
  • PEP8 formatting applied (autopep8)

__init__.py — Empty as expected

Files linted: community/prayer-times/background.py community/prayer-times/main.py

✅ Flake8 — Passed

✅ All checks passed!

@uzair401
Copy link
Copy Markdown
Contributor

Hey @mahsumaktas, Found a few blockers in background.py that need to be fixed before this can be approved:

  1. resume_normal_flow() should not be called inside a daemon loop — remove it entirely from first_function().
  2. send_interrupt_signal() takes no arguments and must be awaited — call await self.capability_worker.send_interrupt_signal() first, then await self.capability_worker.speak(...) separately.

For reference, please check the background daemon template and examples in the repo — they show the correct daemon loop structure, how to use send_interrupt_signal() before speaking, and the right way to handle session tasks: https://github.com/openhome-dev/abilities/tree/dev/templates

@uzair401 uzair401 closed this Mar 17, 2026
mahsumaktas added a commit to mahsumaktas/abilities that referenced this pull request Mar 17, 2026
- Remove resume_normal_flow() from daemon loop (daemons run indefinitely)
- Fix send_interrupt_signal(): no arguments, must be awaited
- Use speak() separately after interrupt signal
- Make _safe_interrupt async with proper await chain

Addresses feedback from @uzair401 on PR openhome-dev#216
@mahsumaktas
Copy link
Copy Markdown
Contributor Author

Hi @uzair401, thanks for the thorough review! I've pushed fixes for both issues:

1. ✅ Removed resume_normal_flow() from the daemon loop

  • Daemons run indefinitely in an infinite while True: loop — resume_normal_flow() is intentionally unreachable and shouldn't be there
  • Verified against the Background and Alarm templates which confirm: "never call resume_normal_flow() (intentionally unreachable)"

2. ✅ Fixed send_interrupt_signal(): now awaited with no arguments

  • Changed _safe_interrupt to async def
  • Replaced send_interrupt_signal(message) with await send_interrupt_signal() + await speak(message)
  • Updated all call sites to await self._safe_interrupt(...)

Fix commit: mahsumaktas@14c25a0

Could you reopen this PR? I don't have write access to the repo so I'm unable to reopen it myself. Thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-ability Community-contributed ability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants