birdman
Moderator
But I think I can see how it goes wrong.Note that I don't know what the fix is for this second bug, as I'm not sure at the moment why the code does what it does.
The only PowerTimer I had in place was the one I was testing. This had an end action of wakeup-to-standby.
So the box was woken up by a PowerTimer, and
/tmp/was_powertimer_wakeup was created at start-up.The only PowerTimer in place was now past its
begin time, so that never got to StateRunningand was just rescheduled for 1 day ahead.
I then edited that timer (or deleted it and created a new test one).
When this did get to
StateRunning it saw /tmp/was_powertimer_wakeup and so set the PowerTimer to be wasPowerTimerWakeup. Consequently this PowerTimer was ignored.I can't see why a PowerTimer to go to DEEPSTANDBY would ever be ignored if the box had been woken up by a PowerTimer.
(Nor why only the first PowerTimer to get to
StateRunning could ever get this setting).Suggestions welcome....