Editing source .cpp locally on HomeAssistant/ESPHome

OK. I am getting started with Home Assistant. I have an assistant box with the LyraT board. I am having issues, and I would like to debug.

Specifically, in the log, I am getting

[14:09:45][D][voice_assistant:422]: Desired state set to STREAMING_MICROPHONE
[14:09:45][D][voice_assistant:523]: Event Type: 1
[14:09:45][D][voice_assistant:526]: Assist Pipeline running
[14:09:45][D][voice_assistant:523]: Event Type: 9
[14:09:57][D][voice_assistant:523]: Event Type: 0
[14:09:57][D][voice_assistant:523]: Event Type: 2
[14:09:57][D][voice_assistant:613]: Assist Pipeline ended

I see in ESPHome: /opt/build/esphome/esphome/components/voice_assistant/voice_assistant.cpp Source File and related files that event type 0 means error and that it is handled at line 632 in the .cpp file. I would like to edit that file to provide more information. I expected to find the file locally on my HomeAssistant box, hack in a few lines, compile and install. I can’t even find the .cpp file on my disk.

I expect that there is a document somewhere that tells me how to make a minor mod like this to debug a problem, but all I am seeing is articles about how to modify the .yaml configuration.

How do I do a simple hack like this?

Thanks,
Mark

Well if you were really keen to make local mods you would download a local copy of the component and use a local external_component. Or fork the repo and do it the GitHub way. I think.

Well yes a big idea behind ESPHome is the developers do the tricky cpp and most users just deal with the simpler yaml layer.

Thanks, @Mahko_Mahko. That is just what I needed to know.

1 Like