Fix set sleep timer via shortcut/siri when locked - #4812
Conversation
|
Hey, @lparry. Thanks for the PR! I will review it as soon as I finish with the current project. |
|
Thank you @kean, I've been running with a build from this git sha the past week, and the sleep timer shortcut has been happily running each time when locked now which has been great for my insomnia. Please let me know if anything needs to be changed or updated to get this over the line, I'm very keen to help get this into trunk and the official app 馃檹 |
|
Thanks @kean re: 1, no, that wasn't intentional. I've found the line responsible and reverted that change, and have verified that it now shows back up within Pocketcasts and that the added Siri shortcut appears to run successfully with a locked device.
re: 2, I think you're right and that once an app exposes one modern AppShortcut, the shortcut app begins hiding legacy INShortcut actions until you tap through and get shown the full list. I could attempt to migrate a few more in a follow-up so that the single action surfaced at the top level doesn't look so lonely if you like? |
Awesome, thank you!
If you're up for it, that would be ideal. I'd suggest doing it in a separate PR. It looks like we'd need to do it sooner than later anyway. I think it'll also be OK to merge as is once 8.18 release branch is cut and finish the migration during the next iteration. I wonder if there is a way to connect |
@kean I've had a crack at getting an agent to do this, and have changed the language on my phone and can confirm that the shortcut will show up in Spanish, but I'm not really sure if this last commit is what you were meaning or not. Happy for it to be discarded if it's no good |


Fixes: #32
This PR fixes issue 32: that the set sleep timer shortcut/action cannot succeed when the device is locked.
This is a critical feature for those suffering from insomnia. When waking part way through the night, the last thing anyone wants to do is unlock their phone in order to make sure that the podcasts they need to get to sleep don't continue running unrestricted.
With this shortcut fixed and the correct bluetooth-device triggered automation configured, all one needs to do is reconnect their bluetooth sleep mask and they'll get another interval of podcasts with zero risk of them continuing to play for hours.
I also added the ability for the shortcut to natively configure the length of the sleep timer. I've never really be able to figure exactly where the old value came from, it was all a bit magic for me; so now it's possible for the shortcut to be the source-of-truth for what actually gets set when the shortcut runs.
To test
Checklist
CHANGELOG.mdif necessary.