-
Notifications
You must be signed in to change notification settings - Fork 101
Wake screen upon encoder rotation #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The encoder can be unintentionally rotated in pocket when you listening radio with headphones while walking |
That's definitely true, but if you are actively using the receiver and it goes into sleep, it's much more intuitive to wake it with a rotation. We need either a menu option to toggle this behavior or implement a mechanism to discard unintentional rotations. |
|
@cringeops Hi! Unfortunately, this change breaks an existing use case: SLEEP_LOCKED was added to allow carrying the receiver in a pocket (one user even uses a short wire antenna as a lanyard). But if your use case involves automatic sleep timer, we can allow wake up on rotation in a similar way as it was done for click: https://github.com/esp32-si4732/ats-mini/blob/v2.28/ats-mini/ats-mini.ino#L800-L806 Undo your change, then add something like this (untested) below the changed line: But this is not enough. To wake up from And all of this requires thorough testing in all modes. |
|
@max-arnold Thank you for your input! Indeed, my use-case involves sleep on timer. I propose the following logic: we allow wake with a rotation only on sleep on timer, and ignore rotations when sleep is invoked by user (putting the device to sleep with a long encoder press before putting it in a pocket, for instance). I believe this logic to be the best of both worlds: user can intuitively wake the device and continue band tuning with a rotation if it sleeps on him, and it won't accidentally wake in a pocket when put to sleep by user. |
|
Currently there is no distinction between the ways a receiver was put to sleep. For simplicity, I just check if Maybe it is worth adding another sleep state (not just true/false) to remember how the device was put to sleep (timer vs long press) and allow different wake up gestures based on that |
|
Okay, I followed the same logic with I tested and verified the following use cases:
While I find my changes quite useful for me, I see an obvious issue: I can't keep sleep timer enabled to walk with the radio in my pocket because rotary events will wake it. To avoid that, I have to disable the timer and put the device into sleep manually. So, there is a decision to be made: we either go on with this compromise solution or actually implement a sleep trigger flag to differentiate between user-invoked and timer-invoked sleep. Edit: Also, I just realized that in locked mode the device won't actually wake up. It means that this piece of logic is not needed at all. |
|
Could you please rebase this PR against the latest main branch? |
|
Sure, I will do that on a weekend once I turn back to the project. I'm still thinking on the actual logic of this feature, to be honest. I think we probably should separate sleep mode and lock functions because I deem they should be independent of each other. For example, I may want to have a CPU sleep with locked encoder when on the move and CPU sleep on timer when I'm casually surfing the bands but want my radio to wake up on encoder action. Therefore, I propose the following logic:
|
I would prefer to avoid adding another menu option |
I found it absolutely terrible in terms of UX to wake the screen with encoder press. It feels much more natural to wake it with encoder rotation.
If we don't want it to be the only option, we can still make it an option via the settings menu.