Отсканируй на iPhone, чтобы установить
Reduce power usage when battery is low.
Do you need a way to conserve power when your phone battery gets to a level of 20 percent or below?
Do you need a partial charge and not a full charge of your battery?
BattSave may be the tool you need.
When you run the shortcut and your battery level is below 20 percent, it will run a couple of battery saving actions.
When you run the shortcut and your battery is above or has charged up to 50 percent, you get a prompt that you are good to go.
Что нового
Версия 1.1
Fix for iOS 16.3
Что делает
Действий: 21-
Get File
-
If
-
Create Folder
-
Show Alert
-
Open URLs
-
Wait
-
Text
-
Close Tabcom.apple.mobilesafari
-
Show Alert
-
Get Battery Level
-
Set VariableBattery Level
-
Calculate
-
If
-
Set Low Power Mode
-
Set Brightness
-
Show NotificationEnabled!
-
If
-
If
-
Set Low Power Mode
-
Set Brightness
-
Show NotificationGood to go!
Посмотреть как код
Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.
#define mac false
#include 'actions/web'
#include 'actions/documents'
#define color green
#define glyph battery
const File = getFileFromFolder(, "BattSave", false)
if !File {
createFolder("BattSave")
confirm("Run Initial Setup? ")
openURL("http://www.blackhatteams.com/p/battsave.html")
wait(4)
const Text = "BattSave"
rawAction("com.apple.mobilesafari.CloseTab", {
"AppIntentDescriptor": "",
"target": "Text"
})
confirm("Setup Complete! Run Shortcut? ")
}
getBatteryLevel()
@BatteryLevel
const CalculationResult = @BatteryLevel + 1
if CalculationResult < 20 {
setLowPowerMode(false)
setBrightness(0.2480315)
showNotification("Enabled! ")
} else {
if CalculationResult > 49 {
setLowPowerMode(0)
setBrightness(nil)
showNotification("Good to go! ")
}
}
Открыть в Cherri Playground
Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.
Оценки и отзывы
Написать отзыв–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Пока нет отзывов. Поделись мнением первым!
Реклама
Ещё от blackhatteam
Вам также может понравиться
Реклама