Files
linux-voice-assistant/linux_voice_assistant
imonlinux 2cdabdad30 Update mqtt_controller.py
Goal: We'll apply the exact same pattern to the MqttController. The paho-mqtt library runs its _on_message callback in a separate thread. We'll stop it from modifying state directly and instead schedule a new function to run on the main asyncio loop.

Here is the complete file. The key changes are:

The _on_message function is now tiny. It just gets the topic/payload and uses self.state.loop.call_soon_threadsafe to schedule a new function.

A new function _handle_message_on_loop contains all the logic that used to be in _on_message. This new function will run safely on the main asyncio loop, eliminating the race condition.
2025-11-17 14:44:41 -08:00
..
2025-08-26 09:30:58 -05:00
2025-10-15 20:33:24 -07:00
2025-11-11 20:33:59 -08:00
2025-10-12 10:09:45 -07:00
2025-09-16 15:05:18 -05:00
2025-11-17 14:44:41 -08:00
2025-09-16 15:05:18 -05:00
2025-10-15 09:31:26 -07:00
2025-08-26 09:30:58 -05:00
2025-09-16 15:05:18 -05:00
2025-09-18 10:52:56 -05:00