Auto play after power cut

It is actually quite simple.
The Arylic S10 has just 4 presets stored with favorite internet radio stations.
I have flashed a Tuya smart plug with esphome firmware. Configuration is available here:

It simply checks every 30 seconds if the S10 is in playing state, if not it restores last preset, if there is no last one it will play preset 1. If it can’t reach the API of S10 it will restart the relay so it goes back online - this helps in case any network connectivity problem of the S10 or in case someone turns it off e.g. with remote or the button in the back.
I’ve made some tests e.g. complete power cut, S10 power off, S10 pause etc and seems to work as expected.
I’ll be installing it in target place on the following weekend and will see how it works in a longer run.