Open gpayer opened 5 months ago
Just use an io.BytesIO() object (without initial data) as your temp_file. Then call temp_file.seek(0) after putting in the wav data and you can put it directly inside form.add_field instead of file_to_send.
Then you don't have the hassle of blocking operations and local temp files. And that means you can get rid of the finally
part as well.
I'll just copy the warning message from the home assistant log: