Google 剛公佈推出 Sleep API 讓應用程式可透過 API 判斷用家的睡眠狀況。Tasker 最新推出的 5.12.3 Beta 版本亦已經支援,用家可以在 Tasker 內設定 Sleeping State,當裝置符合 Sleeping State 就可觸發執行指定的 Task 任務。
透過 Sleeping Confidence 判斷
Google Sleep API 是透過裝置的感光和動作感應器,並透過機器學習判斷用家的睡眠情況,由於 Sleep API 是設於 Google Play Services 所以運行使用亦較節省電量而且數據亦會更準確。Sleep API 可匯報 Sleep Confidences,用於判斷用家有多大可能處於睡眠狀況,在 Tasker 內的 Sleeping State 就是依據 Sleep Confidences 作出判斷。
在 Tasker 5.12.3 Beta 內,新增 Profile 內裏選擇 State 就可找到 Sleeping State。在 Sleeping State 設定 Parameters 十分簡單,就是 Minimum Confidence, Maximum Light 和 Motion。簡單來設就是當 Sleep API 匯報的 Sleep Confidence 超越了 Tasker 內所定的 Minimum Confidence 就會視為進入 Sleeping State,跟住就可觸發執行指定的 Task。
Tasker 5.12.3 Beta 除了 Sleeping State 外,還有其他的改進和修正。
– Added Sleeping state: track your sleep with Tasker
– Added helper in HTTP Request action’s Headers field to easily set commonly used headers
– Added ADB Wifi helper for easy setup of permission granting/revoking commands
– Made the Monospace-not-wrapped text in certain input fields optional (Preferences > UI)
– Fix Tick event not working reliably if the screen is off on some devices
– Try to fix clipboard change sensing on Android 11 on some specific devices
– If you search for something like Perform when adding an action and you have some tasks with the word “perform” in them, don’t use them to autofill the Perform Task‘s Name field
– Don’t show structured global variables with . in their name in the VARS tab
– Now when reading a structured output, if there’s no match and the variable has been marked as a structured variable, it’ll correctly evaluate in the “If Not Set” condition. If you use the variable with structure access, the literal value will be used.
– When reading HTML structure with the square bracket notation use curly braces for attribute matching eg. {attr=value} instead of [attr=value] – Allow using an empty key when accessing a structured variable, eg. %json[] – Check if a variable is of the specific type used in the “Set Variable Structure Type” action
– Fixed crash when adding certain events/states
– Fixed using setLocal() function in Scene WebView for project/profile/task variables
– Fixed setting project/profile/task variables from the “Java Function” action
– Fixed bug where if you select the “Perform Task” action based on a search for a task name, the priority would be incorrectly initiated to 5 instead of %priority
– Try to fix external SD card or USB OTG on Android 11+. Not fully working yet.