lanrat / homeplate

Home Assistant E-Ink Dashboard on the Inkplate 10

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Activity deadlock when action is "hass"

elratt0r opened this issue · comments

When having a mqtt message pending with {"action": "hass"} and the homeplate boots from timer/wake button, it will start up with activity HomeAssistant, connect to the WiFi, pass the waitForWiFiOrActivityChange() but then during run of remotePNG gets aborted by the stopActivity() because resetActivity = true is set by the incoming mqtt message. The pending activity from mqtt is not run because debounce conditions apply.

I think it should get caugth here instead, but because activityCurrent gets set after the activity is done running, it never applies.

Two ideas for solutions:
Set activityCurrent = activityNext right after accepting the activity to be run (here)

Checking resetActivity after running remotePNG to check if it was aborted and then use "continue" in the while loop instead of falling through and setting activityCurrent = activityNext.

Patch for solution 1 here

Good find.

I'm fine with either of your proposed solutions. If you send a PR for either I'll merge it.