fix: disable wifi when playing songs on buzzer#19
Conversation
Stops ESP chip from resetting when playing songs at 50% on the buzzer.
WalkthroughAdds four new playback scripts to the ESPHome H-2 YAML that sequence light actions, toggle Wi‑Fi around RTTTL playback, wait, turn off lights, and call the existing sleep-check script. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
.DS_Storeis excluded by!**/.DS_Store
📒 Files selected for processing (1)
Integrations/ESPHome/H-2.yaml(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
Integrations/ESPHome/H-2.yaml
[error] 257-257: duplication of key "script" in mapping
(key-duplicates)
🔇 Additional comments (1)
Integrations/ESPHome/H-2.yaml (1)
258-332:rtttl.playis non-blocking; WiFi will re-enable before playback completes.The fix disables WiFi before playback but re-enables it immediately after the
rtttl.playaction returns. Sincertttl.playprovides anon_finished_playbackcallback, this action is non-blocking and returns before the song finishes. WiFi will be re-enabled mid-playback, leaving the reset vulnerability unresolved.Use the
on_finished_playbackcallback instead: deferwifi.enableand subsequent actions until after playback completes.
|
seems to work merging then doing more testing thanks man! |
Version:
What does this implement/fix?
Stops ESP chip from resetting when playing songs at 50% on the buzzer.
Types of changes
Checklist / Checklijst:
If user-visible functionality or configuration variables are added/modified:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.