Device Actions
Table of contents
- Get Device Detail
- Get On-Screen Content
- Get Orientation
- Lock Screen
- Reboot
- Set Airplane Mode
- Shut Down
- Toggle Airplane Mode
- Vibrate Device
- Show Control Center
- Battery
- Screen Time
To use actions in this category, use this include statement:
#include 'actions/device'
Get Device Detail
Get a detail about current device.
enum deviceDetail {
'Device Name',
'Device Hostname',
'Device Model',
'Device Is Watch',
'System Version',
'Screen Width',
'Screen Height',
'Current Volume',
'Current Brightness',
'Current Appearance',
}
getDeviceDetail(deviceDetail detail)
Get On-Screen Content
Get the content currently on-screen.
getOnScreenContent()
Get Orientation
Get the current orientation of the device.
getOrientation(): text
Lock Screen
Lock the device screen.
lockScreen()
Reboot
Power off the device, then power it on again.
reboot()
Set Airplane Mode
setAirplaneMode(bool status)
Shut Down
Power off the device.
shutdown()
Toggle Airplane Mode
toggleAirplaneMode()
Vibrate Device
Vibrate the device. Only applies to Apple devices with the haptic engine.
vibrate()
Only supported on iOS/iPadOS.
Show Control Center
Open the control center on the device.
showControlCenter()
Battery
Connected to Charger
Determines if the device is currently connected to a charger.
connectedToCharger(): bool
Get Battery Level
Get the current level of charge of the device battery.
getBatteryLevel()
Is Charging
Determines if the device is currently charging.
isCharging(): bool
Screen Time
Get Website & App Activity
enum deviceUsageType {
'all',
'app',
'website',
}
enum usageDuration {
'today',
'yesterday',
'lastWeek',
'thisWeek',
'thisMonth',
'thisYear',
'specifiedDay',
'inBetween',
}
getDeviceUsage(deviceUsageType ?usageType = "all", variable ?device, usageDuration ?during = "today", text ?startTime, text ?startTime)