Skip to content

Conversation

@bdraco
Copy link
Member

@bdraco bdraco commented Nov 5, 2025

What does this implement/fix?

Documents the App.wake_loop_threadsafe() API added in esphome/esphome#11681 for components that need to wake the main loop from background threads/FreeRTOS tasks.

Changes

Adds new section to docs/architecture/components/advanced.md:

  • Setup instructions (Python: add socket dependency, call require_wake_loop_threadsafe())
  • Usage pattern (C++: call App.wake_loop_threadsafe() from background thread context)
  • Platform support (ESP32-IDF and LibreTiny only)
  • Best practices on when to wake (interactive, time-critical) vs when not to (high-frequency events)
  • Safety notes (thread-safe but not ISR-safe)

Related PRs: esphome/esphome#11681 (implementation), esphome/esphome#11677 (selective waking example)

@netlify
Copy link

netlify bot commented Nov 5, 2025

Deploy Preview for esphome-dev-docs ready!

Name Link
🔨 Latest commit 4563020
🔍 Latest deploy log https://app.netlify.com/projects/esphome-dev-docs/deploys/690bc315cb73910008a4a4ef
😎 Deploy Preview https://deploy-preview-63--esphome-dev-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bdraco bdraco marked this pull request as ready for review November 5, 2025 21:37
Copilot AI review requested due to automatic review settings November 5, 2025 21:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds documentation for a new feature that allows components to wake the main loop from background threads for low-latency event processing. The feature uses App.wake_loop_threadsafe() to avoid the 0-16ms select() timeout delay.

  • Added comprehensive documentation for the wake_loop_threadsafe() API
  • Documented platform support (ESP32 ESP-IDF and LibreTiny only)
  • Provided setup instructions and usage examples with best practices

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jesserockz jesserockz merged commit 98f303c into main Nov 7, 2025
10 checks passed
@jesserockz jesserockz deleted the main_loop branch November 7, 2025 21:28
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants