Skip to content

perf: reply to Flow Launcher before Home Assistant responds - #75

Merged
Garulf merged 1 commit into
mainfrom
t3code/reduce-launcher-delay-on-select
Oct 3, 2026
Merged

Garulf merged 1 commit into
mainfrom
t3code/reduce-launcher-delay-on-select

Conversation

@Garulf

@Garulf Garulf commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • action now schedules the Home Assistant service call as a background task and returns right away, so Flow Launcher hides as soon as an entity is selected instead of waiting on the HTTP round trip.
  • The call moved into send_service_call. Running tasks are kept in pending_service_calls so they aren't garbage collected before they finish.
  • Errors from Home Assistant can no longer be returned from action, so they are now sent through the launcher API as a ShowMsg notification.

Testing

  • Added test_action_replies_before_home_assistant_responds: a blocked call_service doesn't delay the reply from action, and the call still runs with the right arguments once released.
  • Added test_action_reports_home_assistant_errors: a failing call_service produces a Flow.Launcher.ShowMsg with the "Home Assistant error" title and the error text.
  • Not run: manual check inside Flow Launcher against a live Home Assistant instance.

- Run the service call as a background task so the launcher hides right away
- Report Home Assistant errors through a separate ShowMsg call
- Add tests for the early reply and the error path
@Garulf
Garulf merged commit 0b5504f into main Oct 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant