hass-integrations
hass-integrations copied to clipboard
service calls are skipped when called in quick succession
Hey hey,
I noticed an issue whenever services are called in quick succession, sometimes (not always) only the first command gets executed. For example, I have a ha-script that sets consume_mode
shuffle
& repeat
in this order but the only thing that gets applied is the consume-mode.
I did A LOT of testing and found out that calls in succession work fine but calls in parallel occasionally cause one or more calls to get skipped.
The reason why only consume mode is set in my first example is that another script is running in parallel that adds a song to the playlist and it is pretty random which call gets skipped if one or more calls are executed in parallel. I am 90% sure about that assessment. I will keep on testing :)
The actions which did not result in the expected state, did they return an error? The only thing I can think of which might be happening, is that the Mopidy client api wrapper is busy and drops requests while it is busy. Time to introduce a task queue, maybe...
The actions which did not result in the expected state, did they return an error?
I have to reproduce that to check for errors. I already adjusted my scripts to work around that. In hindsight, doing it in parallel wasn't a good idea for me anyway :smile: Next year I will get back at it, test and report, as I do :smile_cat: