@signageos/front-applet 8.2.1 → 8.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/docs/index.md +9 -9
- package/docs/sos/browser.md +11 -3
- package/docs/sos/display.md +13 -20
- package/docs/sos/fileSystem.md +31 -6
- package/docs/sos/hardware/barcodeScanner.md +9 -0
- package/docs/sos/hardware/index.md +9 -0
- package/docs/sos/native/mdc.md +8 -3
- package/docs/sos/osd.md +9 -0
- package/docs/sos/video.md +9 -0
- package/docs/sos_management/app.md +97 -18
- package/docs/sos_management/audio.md +43 -2
- package/docs/sos_management/autoRecovery.md +101 -0
- package/docs/sos_management/debug.md +84 -1
- package/docs/sos_management/firmware.md +64 -1
- package/docs/sos_management/index.md +217 -19
- package/docs/sos_management/network.md +84 -29
- package/docs/sos_management/os.md +59 -4
- package/docs/sos_management/package.md +25 -3
- package/docs/sos_management/power.md +142 -18
- package/docs/sos_management/proxy.md +54 -3
- package/docs/sos_management/remoteControl.md +55 -4
- package/docs/sos_management/screen.md +140 -29
- package/docs/sos_management/security.md +48 -5
- package/docs/sos_management/time.md +76 -9
- package/docs/sos_management/wifi.md +207 -45
- package/es6/FrontApplet/Browser/Browser.d.ts +11 -3
- package/es6/FrontApplet/Browser/Browser.js +11 -3
- package/es6/FrontApplet/Browser/Browser.js.map +1 -1
- package/es6/FrontApplet/Command/Command.js +1 -0
- package/es6/FrontApplet/Command/Command.js.map +1 -1
- package/es6/FrontApplet/Display/Display.d.ts +14 -19
- package/es6/FrontApplet/Display/Display.js +14 -19
- package/es6/FrontApplet/Display/Display.js.map +1 -1
- package/es6/FrontApplet/FileSystem/FileSystem.d.ts +27 -5
- package/es6/FrontApplet/FileSystem/FileSystem.js +27 -5
- package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.d.ts +9 -0
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js +9 -0
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js.map +1 -1
- package/es6/FrontApplet/Hardware/Hardware.d.ts +9 -0
- package/es6/FrontApplet/Hardware/Hardware.js +9 -0
- package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
- package/es6/FrontApplet/Management/App/App.d.ts +53 -17
- package/es6/FrontApplet/Management/App/App.js +23 -12
- package/es6/FrontApplet/Management/App/App.js.map +1 -1
- package/es6/FrontApplet/Management/App/IApp.d.ts +3 -0
- package/es6/FrontApplet/Management/Audio/Audio.d.ts +24 -3
- package/es6/FrontApplet/Management/Audio/Audio.js +24 -3
- package/es6/FrontApplet/Management/Audio/Audio.js.map +1 -1
- package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.d.ts +49 -3
- package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js +49 -3
- package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js.map +1 -1
- package/es6/FrontApplet/Management/Debug/Debug.d.ts +44 -2
- package/es6/FrontApplet/Management/Debug/Debug.js +43 -1
- package/es6/FrontApplet/Management/Debug/Debug.js.map +1 -1
- package/es6/FrontApplet/Management/Firmware/Firmware.d.ts +41 -4
- package/es6/FrontApplet/Management/Firmware/Firmware.js +33 -0
- package/es6/FrontApplet/Management/Firmware/Firmware.js.map +1 -1
- package/es6/FrontApplet/Management/Management.d.ts +119 -21
- package/es6/FrontApplet/Management/Management.js +119 -22
- package/es6/FrontApplet/Management/Management.js.map +1 -1
- package/es6/FrontApplet/Management/Network/Network.d.ts +44 -25
- package/es6/FrontApplet/Management/Network/Network.js +28 -14
- package/es6/FrontApplet/Management/Network/Network.js.map +1 -1
- package/es6/FrontApplet/Management/OS/IOS.d.ts +3 -0
- package/es6/FrontApplet/Management/OS/OS.d.ts +32 -4
- package/es6/FrontApplet/Management/OS/OS.js +32 -4
- package/es6/FrontApplet/Management/OS/OS.js.map +1 -1
- package/es6/FrontApplet/Management/Package/Package.d.ts +18 -3
- package/es6/FrontApplet/Management/Package/Package.js +18 -4
- package/es6/FrontApplet/Management/Package/Package.js.map +1 -1
- package/es6/FrontApplet/Management/Power/IPower.d.ts +3 -0
- package/es6/FrontApplet/Management/Power/IPower.js.map +1 -1
- package/es6/FrontApplet/Management/Power/Power.d.ts +67 -20
- package/es6/FrontApplet/Management/Power/Power.js +70 -24
- package/es6/FrontApplet/Management/Power/Power.js.map +1 -1
- package/es6/FrontApplet/Management/Proxy/Proxy.d.ts +28 -3
- package/es6/FrontApplet/Management/Proxy/Proxy.js +28 -3
- package/es6/FrontApplet/Management/Proxy/Proxy.js.map +1 -1
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.d.ts +23 -5
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js +23 -5
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js.map +1 -1
- package/es6/FrontApplet/Management/Screen/Screen.d.ts +77 -32
- package/es6/FrontApplet/Management/Screen/Screen.js +65 -26
- package/es6/FrontApplet/Management/Screen/Screen.js.map +1 -1
- package/es6/FrontApplet/Management/Security/Security.d.ts +25 -7
- package/es6/FrontApplet/Management/Security/Security.js +25 -7
- package/es6/FrontApplet/Management/Security/Security.js.map +1 -1
- package/es6/FrontApplet/Management/Time/Time.d.ts +47 -11
- package/es6/FrontApplet/Management/Time/Time.js +29 -7
- package/es6/FrontApplet/Management/Time/Time.js.map +1 -1
- package/es6/FrontApplet/Management/Wifi/IWifi.d.ts +3 -0
- package/es6/FrontApplet/Management/Wifi/IWifi.js.map +1 -1
- package/es6/FrontApplet/Management/Wifi/Wifi.d.ts +137 -42
- package/es6/FrontApplet/Management/Wifi/Wifi.js +137 -42
- package/es6/FrontApplet/Management/Wifi/Wifi.js.map +1 -1
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.d.ts +8 -3
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js +8 -3
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js.map +1 -1
- package/es6/FrontApplet/OSD/OSD.d.ts +9 -0
- package/es6/FrontApplet/OSD/OSD.js +9 -0
- package/es6/FrontApplet/OSD/OSD.js.map +1 -1
- package/es6/FrontApplet/Video/Video.d.ts +9 -0
- package/es6/FrontApplet/Video/Video.js +9 -0
- package/es6/FrontApplet/Video/Video.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,24 +4,25 @@ sidebar_position: 0
|
|
|
4
4
|
|
|
5
5
|
# network
|
|
6
6
|
|
|
7
|
-
The `sos.management.network` API groups together methods
|
|
7
|
+
The `sos.management.network` API groups together networking methods. For Wi-Fi setup, use the [Wi-Fi API](https://developers.signageos.io/sdk/sos_management/wifi).
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<details>
|
|
10
|
+
<summary>Network Management Capabilities</summary>
|
|
11
|
+
| Capability | Description |
|
|
12
|
+
|:------------|:-------------|
|
|
13
|
+
| `NETWORK_INFO` | If device supports returning network information |
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
:::
|
|
15
|
+
If you want to check if the device supports this capability, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
16
|
+
</details>
|
|
14
17
|
|
|
15
18
|
## Methods
|
|
16
19
|
|
|
17
20
|
### disableInterface()
|
|
18
21
|
|
|
19
|
-
The `disableInterface()`
|
|
22
|
+
The `disableInterface()` turns off a selected network interface.
|
|
20
23
|
|
|
21
24
|
:::warning
|
|
22
|
-
|
|
23
|
-
Don't use this method to disable Wi-Fi. Use [Wi-Fi API](./wifi) to enable/disable Wi-Fi.
|
|
24
|
-
|
|
25
|
+
Don't use this method to disable Wi-Fi. Use [Wi-Fi API](https://developers.signageos.io/sdk/sos_management/wifi) to turn Wi-Fi on/off.
|
|
25
26
|
:::
|
|
26
27
|
|
|
27
28
|
```ts expandable
|
|
@@ -30,17 +31,32 @@ disableInterface(interfaceName: string): Promise<void>;
|
|
|
30
31
|
|
|
31
32
|
#### Params
|
|
32
33
|
|
|
33
|
-
| Name | Type | Required | Description
|
|
34
|
-
|
|
35
|
-
| `interfaceName` | `string` | <div>Yes</div> | The interface name which can be retrieved from the list of interfaces returned by listInterfaces() |
|
|
34
|
+
| Name | Type | Required | Description |
|
|
35
|
+
|-----------------|----------|------------------|------------------------------------------------------------------------------------------------------|
|
|
36
|
+
| `interfaceName` | `string` | <div>Yes</div> | The interface name which can be retrieved from the list of interfaces returned by `listInterfaces()` |
|
|
37
|
+
|
|
38
|
+
#### Return value
|
|
39
|
+
|
|
40
|
+
A promise that resolves when the network interface is disabled.
|
|
41
|
+
|
|
42
|
+
#### Possible errors
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
- If the interface name is invalid.
|
|
46
|
+
- If the device does not support network management.
|
|
47
|
+
|
|
48
|
+
#### Example
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
await sos.management.network.disableInterface('eth0');
|
|
52
|
+
```
|
|
36
53
|
|
|
37
54
|
<Separator />
|
|
38
55
|
|
|
39
56
|
### listInterfaces()
|
|
40
57
|
|
|
41
|
-
The `listInterface()` method returns list of all network interfaces, and their information like MAC address, IP address, etc.
|
|
42
|
-
connection strength is described as percentage in range from 0 to 100, linearly converted from dBm -90 to -30 respectively based on
|
|
43
|
-
platform.
|
|
58
|
+
The `listInterface()` method returns a list of all network interfaces, and their information like MAC address, IP address, etc.
|
|
59
|
+
Wi-Fi connection strength is described as a percentage in the range from 0 to 100, linearly converted from dBm -90 to -30, respectively, based on the platform.
|
|
44
60
|
|
|
45
61
|
```ts expandable
|
|
46
62
|
listInterfaces(): Promise<INetworkInterface[]>;
|
|
@@ -67,16 +83,33 @@ type NetworkInterface = 'wifi' | 'ethernet';
|
|
|
67
83
|
|
|
68
84
|
```
|
|
69
85
|
|
|
86
|
+
#### Return value
|
|
87
|
+
|
|
88
|
+
Resolves to an array of network interfaces with their information.
|
|
89
|
+
|
|
90
|
+
#### Example
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
const interfaces = await sos.management.network.listInterfaces();
|
|
94
|
+
interfaces.forEach((iface) => {
|
|
95
|
+
console.log(`Interface: ${iface.name}, IP: ${iface.ipAddress}, MAC: ${iface.macAddress}`);
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
:::note[GitHub Example]
|
|
100
|
+
|
|
101
|
+
- [ Applet Example with Network Interfaces](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/network)
|
|
102
|
+
|
|
103
|
+
:::
|
|
104
|
+
|
|
70
105
|
<Separator />
|
|
71
106
|
|
|
72
107
|
### setDHCP(interfaceName)
|
|
73
108
|
|
|
74
|
-
The `setDHCP()` method configures a network interface to use DHCP.
|
|
109
|
+
The `setDHCP()` method configures a selected network interface to use DHCP.
|
|
75
110
|
|
|
76
111
|
:::warning
|
|
77
|
-
|
|
78
|
-
Wi-Fi interface can be configured with this method but it has to be first enabled via the [Wi-Fi API](./wifi#enableClient).
|
|
79
|
-
|
|
112
|
+
Wi-Fi interface can be configured with this method, but it has to be first enabled via the [Wi-Fi API](https://developers.signageos.io/sdk/sos_management/wifi#enableclient).
|
|
80
113
|
:::
|
|
81
114
|
|
|
82
115
|
```ts expandable
|
|
@@ -85,9 +118,19 @@ setDHCP(interfaceName: string): Promise<void>;
|
|
|
85
118
|
|
|
86
119
|
#### Params
|
|
87
120
|
|
|
88
|
-
| Name | Type | Required | Description
|
|
89
|
-
|
|
90
|
-
| `interfaceName` | `string` | <div>Yes</div> | The interface name which can be retrieved from the list of interfaces returned by listInterfaces() |
|
|
121
|
+
| Name | Type | Required | Description |
|
|
122
|
+
|-----------------|----------|------------------|------------------------------------------------------------------------------------------------------|
|
|
123
|
+
| `interfaceName` | `string` | <div>Yes</div> | The interface name which can be retrieved from the list of interfaces returned by `listInterfaces()` |
|
|
124
|
+
|
|
125
|
+
#### Return value
|
|
126
|
+
|
|
127
|
+
A promise that resolves when the network interface is set to use DHCP.
|
|
128
|
+
|
|
129
|
+
#### Example
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
await sos.management.network.setDHCP('eth0');
|
|
133
|
+
```
|
|
91
134
|
|
|
92
135
|
<Separator />
|
|
93
136
|
|
|
@@ -96,9 +139,7 @@ setDHCP(interfaceName: string): Promise<void>;
|
|
|
96
139
|
The `setManual()` method manually configures a network interface.
|
|
97
140
|
|
|
98
141
|
:::warning
|
|
99
|
-
|
|
100
|
-
Wi-Fi interface can be configured with this method but it has to be first enabled via the [Wi-Fi API](./wifi#enableClient).
|
|
101
|
-
|
|
142
|
+
Wi-Fi interface can be configured with this method, but it has to be first enabled via the [Wi-Fi API](https://developers.signageos.io/sdk/sos_management/wifi#enableclient).
|
|
102
143
|
:::
|
|
103
144
|
|
|
104
145
|
```ts expandable
|
|
@@ -115,10 +156,24 @@ interface INetworkOptions {
|
|
|
115
156
|
|
|
116
157
|
#### Params
|
|
117
158
|
|
|
118
|
-
| Name
|
|
119
|
-
|
|
120
|
-
| `interfaceName`
|
|
121
|
-
| `options`
|
|
159
|
+
| Name | Type | Required | Description |
|
|
160
|
+
|------------------------|-------------------|------------------|------------------------------------------------------------------------------------------------------|
|
|
161
|
+
| `interfaceName` | `string` | <div>Yes</div> | The interface name which can be retrieved from the list of interfaces returned by `listInterfaces()` |
|
|
162
|
+
| `options` | `INetworkOptions` | <div>Yes</div> | The network configuration options. |
|
|
163
|
+
| `options.localAddress` | `string` | <div>Yes</div> | The local IP address to be set. |
|
|
164
|
+
| `options.gateway` | `string` | <div>Yes</div> | The gateway IP address to be set. |
|
|
165
|
+
| `options.netmask` | `string` | <div>Yes</div> | The netmask to be set. |
|
|
166
|
+
| `options.dns` | `string[]` | <div>Yes</div> | The DNS server array of IP addresses to be set. |
|
|
167
|
+
|
|
168
|
+
#### Return value
|
|
169
|
+
|
|
170
|
+
A promise that resolves when the network is set.
|
|
171
|
+
|
|
172
|
+
#### Possible errors
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
- If the network options are invalid.
|
|
176
|
+
- If the device does not support network management.
|
|
122
177
|
|
|
123
178
|
<Separator />
|
|
124
179
|
|
|
@@ -6,22 +6,48 @@ sidebar_position: 0
|
|
|
6
6
|
|
|
7
7
|
The `sos.management.os` API groups together methods for retrieving information about the system.
|
|
8
8
|
|
|
9
|
+
|
|
10
|
+
<details>
|
|
11
|
+
<summary>OS Management Capabilities</summary>
|
|
12
|
+
| Capability | Description |
|
|
13
|
+
|:------------|:-------------|
|
|
14
|
+
| `SYSTEM_CPU` | If device supports collecting CPU usage information |
|
|
15
|
+
| `SYSTEM_MEMORY` | If device supports collecting memory usage information |
|
|
16
|
+
|
|
17
|
+
If you want to check if the device supports those capabilities, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
18
|
+
</details>
|
|
19
|
+
|
|
9
20
|
## Methods
|
|
10
21
|
|
|
11
22
|
### getCpuUsage()
|
|
12
23
|
|
|
13
|
-
The `getCpuUsage()` method returns current CPU usage (ranging 0
|
|
24
|
+
The `getCpuUsage()` method returns the current total CPU usage (ranging from 0 to 100%).
|
|
14
25
|
|
|
15
26
|
```ts expandable
|
|
16
27
|
getCpuUsage(): Promise<number>;
|
|
17
28
|
```
|
|
18
29
|
|
|
30
|
+
#### Return value
|
|
31
|
+
|
|
32
|
+
Resolves to the current CPU usage percentage.
|
|
33
|
+
|
|
34
|
+
#### Possible errors
|
|
35
|
+
|
|
36
|
+
If the CPU usage is not supported.
|
|
37
|
+
|
|
38
|
+
#### Example
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
const cpuUsage = await sos.management.os.getCpuUsage();
|
|
42
|
+
console.log(`Current CPU usage is: ${cpuUsage}%`);
|
|
43
|
+
```
|
|
44
|
+
|
|
19
45
|
<Separator />
|
|
20
46
|
|
|
21
47
|
### getInfo()
|
|
22
48
|
|
|
23
|
-
The `getInfo()` method returns info about the system of the device, such as what current version of it is installed on
|
|
24
|
-
version of current operating system. It's usually 1 or 2 digits including or excluding dot notation.
|
|
49
|
+
The `getInfo()` method returns info about the system of the device, such as what current version of it is installed on the device. Major
|
|
50
|
+
version of the current operating system. It's usually 1 or 2 digits, including or excluding dot notation.
|
|
25
51
|
|
|
26
52
|
```ts expandable
|
|
27
53
|
getInfo(): Promise<IOSInfo>;
|
|
@@ -40,19 +66,48 @@ interface IOSInfo {
|
|
|
40
66
|
|
|
41
67
|
```
|
|
42
68
|
|
|
69
|
+
#### Return value
|
|
70
|
+
|
|
71
|
+
Resolves to an object containing information about the operating system.
|
|
72
|
+
|
|
73
|
+
#### Example
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
const osInfo = await sos.management.os.getInfo();
|
|
77
|
+
console.log(`Current OS version is: ${osInfo.version}`);
|
|
78
|
+
```
|
|
79
|
+
|
|
43
80
|
<Separator />
|
|
44
81
|
|
|
45
82
|
### getMemoryUsage()
|
|
46
83
|
|
|
47
|
-
The `getMemoryUsage()` method returns total memory amount in bytes, currently used memory and remaining free memory.
|
|
84
|
+
The `getMemoryUsage()` method returns the total memory amount in bytes, the currently used memory, and the remaining free memory.
|
|
48
85
|
|
|
49
86
|
```ts expandable
|
|
50
87
|
getMemoryUsage(): Promise<SystemMemoryInfo>;
|
|
51
88
|
// show-more
|
|
89
|
+
/**
|
|
90
|
+
* Returned object from `getMemoryUsage()` method.
|
|
91
|
+
*/
|
|
52
92
|
interface SystemMemoryInfo {
|
|
53
93
|
used: number;
|
|
54
94
|
total: number;
|
|
55
95
|
free: number;
|
|
56
96
|
}
|
|
57
97
|
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Return value
|
|
101
|
+
|
|
102
|
+
Resolves to an object containing total, used, and free memory in bytes.
|
|
103
|
+
|
|
104
|
+
#### Possible errors
|
|
105
|
+
|
|
106
|
+
If the memory usage is not supported.
|
|
107
|
+
|
|
108
|
+
#### Example
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
const memoryUsage = await sos.management.os.getMemoryUsage();
|
|
112
|
+
console.log(`Memory usage: ${((memoryUsage.used / memoryUsage.total) * 100).toFixed(2)}%`);
|
|
58
113
|
```
|
|
@@ -4,13 +4,23 @@ sidebar_position: 0
|
|
|
4
4
|
|
|
5
5
|
# package
|
|
6
6
|
|
|
7
|
-
The `sos.management.package` API groups together methods for installing
|
|
7
|
+
The `sos.management.package` API groups together methods for installing custom Android packages.
|
|
8
|
+
|
|
9
|
+
<details>
|
|
10
|
+
<summary>Package Management Capabilities</summary>
|
|
11
|
+
| Capability | Description |
|
|
12
|
+
|:------------|:-------------|
|
|
13
|
+
| `PACKAGE_INSTALL` | If device supports installing packages |
|
|
14
|
+
| `STOP_PACKAGE` | If device supports stopping packages |
|
|
15
|
+
|
|
16
|
+
If you want to check if the device supports those capabilities, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
17
|
+
</details>
|
|
8
18
|
|
|
9
19
|
## Methods
|
|
10
20
|
|
|
11
21
|
### install()
|
|
12
22
|
|
|
13
|
-
The `install()` method installs a
|
|
23
|
+
The `install()` method installs a particular package from the specified URL.
|
|
14
24
|
|
|
15
25
|
```ts expandable
|
|
16
26
|
install(baseUrl: string, packageName: string, version: string, build: string | null): Promise<void>;
|
|
@@ -21,10 +31,22 @@ install(baseUrl: string, packageName: string, version: string, build: string | n
|
|
|
21
31
|
| Name | Type | Required | Description |
|
|
22
32
|
|---------------|------------------|------------------|------------------------------------|
|
|
23
33
|
| `baseUrl` | `string` | <div>Yes</div> | URL where the package is available |
|
|
24
|
-
| `packageName` | `string` | <div>Yes</div> | Name of the
|
|
34
|
+
| `packageName` | `string` | <div>Yes</div> | Name of the Android package |
|
|
25
35
|
| `version` | `string` | <div>Yes</div> | Package version |
|
|
26
36
|
| `build` | `string \| null` | <div>Yes</div> | If relevant for your device |
|
|
27
37
|
|
|
38
|
+
#### Return value
|
|
39
|
+
|
|
40
|
+
A promise that resolves when the package is successfully installed.
|
|
41
|
+
|
|
42
|
+
#### Possible errors
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
- If `baseUrl` is not a valid URL
|
|
46
|
+
- If `packageName` is not a string
|
|
47
|
+
- If `version` is not a string
|
|
48
|
+
- If `build` is not a string or null
|
|
49
|
+
|
|
28
50
|
<Separator />
|
|
29
51
|
|
|
30
52
|
### stop()
|
|
@@ -7,6 +7,19 @@ sidebar_position: 0
|
|
|
7
7
|
The `sos.management.power` API groups together methods related to the power state of the device. Such as rebooting, shutting down,
|
|
8
8
|
setting timers.
|
|
9
9
|
|
|
10
|
+
<details>
|
|
11
|
+
<summary>Power Management Capabilities</summary>
|
|
12
|
+
| Capability | Description |
|
|
13
|
+
|:------------|:-------------|
|
|
14
|
+
| `SYSTEM_REBOOT` | If device supports system reboot power action |
|
|
15
|
+
| `APP_RESTART` | If device supports app restart power action |
|
|
16
|
+
| `TIMERS_PROPRIETARY` | If device supports proprietary timers |
|
|
17
|
+
| `TIMERS_NATIVE` | If device supports native timers |
|
|
18
|
+
| `SCHEDULE_POWER_ACTION` | If device supports scheduled power actions |
|
|
19
|
+
|
|
20
|
+
If you want to check if the device supports those capabilities, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
21
|
+
</details>
|
|
22
|
+
|
|
10
23
|
## Methods
|
|
11
24
|
|
|
12
25
|
### appRestart()
|
|
@@ -17,6 +30,10 @@ The `appRestart()` method initializes a restart of the signageOS app.
|
|
|
17
30
|
appRestart(): Promise<void>;
|
|
18
31
|
```
|
|
19
32
|
|
|
33
|
+
#### Return value
|
|
34
|
+
|
|
35
|
+
Resolves when the app restart is initiated.
|
|
36
|
+
|
|
20
37
|
#### Example
|
|
21
38
|
|
|
22
39
|
```ts
|
|
@@ -33,6 +50,10 @@ Removes all scheduled reboot rules from the device.
|
|
|
33
50
|
clearScheduledReboots(): Promise<void>;
|
|
34
51
|
```
|
|
35
52
|
|
|
53
|
+
#### Return value
|
|
54
|
+
|
|
55
|
+
Resolves when all scheduled reboots are cleared.
|
|
56
|
+
|
|
36
57
|
#### Example
|
|
37
58
|
|
|
38
59
|
```ts
|
|
@@ -58,6 +79,14 @@ interface IProprietaryTimer {
|
|
|
58
79
|
|
|
59
80
|
```
|
|
60
81
|
|
|
82
|
+
#### Return value
|
|
83
|
+
|
|
84
|
+
Resolves with an array of proprietary timers.
|
|
85
|
+
|
|
86
|
+
#### Possible errors
|
|
87
|
+
|
|
88
|
+
If the timers cannot be retrieved.
|
|
89
|
+
|
|
61
90
|
#### Example
|
|
62
91
|
|
|
63
92
|
```ts
|
|
@@ -68,11 +97,14 @@ const timers = await sos.management.power.getProprietaryTimers();
|
|
|
68
97
|
|
|
69
98
|
### getScheduledReboots()
|
|
70
99
|
|
|
71
|
-
Returns all scheduled reboot rules on the device.
|
|
100
|
+
Returns all scheduled reboot rules on the device set by the `setScheduledReboot()` method.
|
|
72
101
|
|
|
73
102
|
```ts expandable
|
|
74
103
|
getScheduledReboots(): Promise<IScheduledRebootActions[]>;
|
|
75
104
|
// show-more
|
|
105
|
+
/**
|
|
106
|
+
* Interface representing the scheduled reboot action.
|
|
107
|
+
*/
|
|
76
108
|
interface IScheduledRebootActions {
|
|
77
109
|
id: string;
|
|
78
110
|
rule: IScheduledRebootRule;
|
|
@@ -85,6 +117,10 @@ interface IScheduledRebootRule {
|
|
|
85
117
|
|
|
86
118
|
```
|
|
87
119
|
|
|
120
|
+
#### Return value
|
|
121
|
+
|
|
122
|
+
Resolves with an array of scheduled reboot actions.
|
|
123
|
+
|
|
88
124
|
#### Example
|
|
89
125
|
|
|
90
126
|
```ts
|
|
@@ -110,17 +146,21 @@ interface ITimer {
|
|
|
110
146
|
|
|
111
147
|
```
|
|
112
148
|
|
|
149
|
+
#### Return value
|
|
150
|
+
|
|
151
|
+
Resolves with an array of timers.
|
|
152
|
+
|
|
113
153
|
#### Example
|
|
114
154
|
|
|
115
155
|
```ts
|
|
116
|
-
|
|
156
|
+
await sos.management.power.getTimers();
|
|
117
157
|
```
|
|
118
158
|
|
|
119
159
|
<Separator />
|
|
120
160
|
|
|
121
161
|
### removeScheduledReboot()
|
|
122
162
|
|
|
123
|
-
Removes scheduled reboot rule from the device.
|
|
163
|
+
Removes scheduled reboot rule from the device (if it exists).
|
|
124
164
|
|
|
125
165
|
```ts expandable
|
|
126
166
|
removeScheduledReboot(id: string): Promise<void>;
|
|
@@ -128,9 +168,17 @@ removeScheduledReboot(id: string): Promise<void>;
|
|
|
128
168
|
|
|
129
169
|
#### Params
|
|
130
170
|
|
|
131
|
-
| Name | Type | Required | Description
|
|
132
|
-
|
|
133
|
-
| `id` | `string` | <div>Yes</div> |
|
|
171
|
+
| Name | Type | Required | Description |
|
|
172
|
+
|------|----------|------------------|-------------------------------|
|
|
173
|
+
| `id` | `string` | <div>Yes</div> | ID of the rule to be removed. |
|
|
174
|
+
|
|
175
|
+
#### Return value
|
|
176
|
+
|
|
177
|
+
Resolves when the scheduled reboot is removed.
|
|
178
|
+
|
|
179
|
+
#### Possible errors
|
|
180
|
+
|
|
181
|
+
If the `id` is not a string or is empty.
|
|
134
182
|
|
|
135
183
|
#### Example
|
|
136
184
|
|
|
@@ -138,7 +186,7 @@ removeScheduledReboot(id: string): Promise<void>;
|
|
|
138
186
|
// Get scheduled reboots
|
|
139
187
|
const scheduledReboots = await sos.management.power.getScheduledReboots();
|
|
140
188
|
|
|
141
|
-
// Remove scheduled reboot
|
|
189
|
+
// Remove scheduled reboot on the first position
|
|
142
190
|
await sos.management.power.removeScheduledReboot(scheduledReboots[0].id);
|
|
143
191
|
```
|
|
144
192
|
|
|
@@ -163,22 +211,38 @@ setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff:
|
|
|
163
211
|
| `weekdays` | `string[]` | <div>Yes</div> | The days of the week when the timer should be active (`mon`, ..., `sun`). |
|
|
164
212
|
| `keepAppletRunning` | `boolean` | <div>No</div> | If `true`, the applet will be kept running when the timer is active on certain devices. |
|
|
165
213
|
|
|
214
|
+
#### Return value
|
|
215
|
+
|
|
216
|
+
Resolves when the proprietary timer is set.
|
|
217
|
+
|
|
218
|
+
#### Possible errors
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
- If the timer type is invalid or if the time format is incorrect.
|
|
222
|
+
- If the weekdays array contains an invalid weekday.
|
|
223
|
+
- If the `keepAppletRunning` parameter is not a boolean.
|
|
224
|
+
- If the `timeOn` or `timeOff` parameters do not match the expected time format (`HH:mm:ss`).
|
|
225
|
+
- If the `weekdays` parameter is not an array of strings.
|
|
226
|
+
- If the `weekdays` array contains an invalid weekday.
|
|
227
|
+
- If the `timeOn` or `timeOff` parameters do not match the expected time format (`HH:mm:ss`).
|
|
228
|
+
- If the `type` parameter is not a valid timer type (e.g., `TIMER_1`, `TIMER_2`, ..., `TIMER_7`).
|
|
229
|
+
|
|
166
230
|
#### Example
|
|
167
231
|
|
|
168
232
|
```ts
|
|
169
|
-
await sos.management.power.setProprietaryTimer("
|
|
233
|
+
await sos.management.power.setProprietaryTimer("TIMER_2", "08:00:00", "22:00:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], false);
|
|
170
234
|
```
|
|
171
235
|
|
|
172
236
|
<Separator />
|
|
173
237
|
|
|
174
238
|
### setScheduledReboot()
|
|
175
239
|
|
|
176
|
-
Schedule automatic reboot on the device. Calling this function will create one rule.
|
|
177
|
-
It is possible to set multiple rules, which can be later obtained by `getScheduledReboots` function.
|
|
240
|
+
Schedule an automatic reboot on the device. Calling this function will create one rule.
|
|
241
|
+
It is possible to set multiple rules, which can be later obtained by the `getScheduledReboots` function.
|
|
178
242
|
|
|
179
243
|
:::note
|
|
180
|
-
- Setting new scheduled reboot on device might take up to 10 minutes to show in Box.
|
|
181
|
-
- Every new scheduled reboot rule gets unique identifier generated by device,
|
|
244
|
+
- Setting a new scheduled reboot on the device might take up to 10 minutes to show in the Box.
|
|
245
|
+
- Every new scheduled reboot rule gets a unique identifier generated by the device, which might be later returned by `getScheduledReboots()`.
|
|
182
246
|
:::
|
|
183
247
|
|
|
184
248
|
```ts expandable
|
|
@@ -190,10 +254,23 @@ type WeekdayType = 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' |
|
|
|
190
254
|
|
|
191
255
|
#### Params
|
|
192
256
|
|
|
193
|
-
| Name | Type | Required | Description
|
|
194
|
-
|
|
195
|
-
| `weekdays` | `WeekdayType[]` | <div>Yes</div> |
|
|
196
|
-
| `time` | `string` | <div>Yes</div> |
|
|
257
|
+
| Name | Type | Required | Description |
|
|
258
|
+
|------------|-----------------|------------------|----------------------------------------------------------------|
|
|
259
|
+
| `weekdays` | `WeekdayType[]` | <div>Yes</div> | |
|
|
260
|
+
| `time` | `string` | <div>Yes</div> | Time when the reboot should be executed. Format is `HH:mm:ss`. |
|
|
261
|
+
|
|
262
|
+
#### Return value
|
|
263
|
+
|
|
264
|
+
Resolves when the scheduled reboot is set.
|
|
265
|
+
|
|
266
|
+
#### Possible errors
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
- If the `weekdays` parameter is not an array of strings.
|
|
270
|
+
- If the `time` parameter does not match the expected time format (`HH:mm:ss`).
|
|
271
|
+
- If the `weekdays` array contains an invalid weekday.
|
|
272
|
+
- If the `time` parameter is not a string or does not match the expected format (`HH:mm:ss`).
|
|
273
|
+
- If the `weekdays` array is empty or contains invalid values.
|
|
197
274
|
|
|
198
275
|
#### Example
|
|
199
276
|
|
|
@@ -209,7 +286,7 @@ await sos.management.power.setScheduledReboot(["MONDAY", "FRIDAY"], "19:30:00");
|
|
|
209
286
|
|
|
210
287
|
### setTimer()
|
|
211
288
|
|
|
212
|
-
The `
|
|
289
|
+
The `setTimer()` method creates or updates a native timer.
|
|
213
290
|
|
|
214
291
|
```ts expandable
|
|
215
292
|
setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays: string[], volume: number): Promise<void>;
|
|
@@ -225,12 +302,33 @@ setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string |
|
|
|
225
302
|
| `weekdays` | `string[]` | <div>Yes</div> | The days of the week when the timer should be active (`mon`, ..., `sun`). |
|
|
226
303
|
| `volume` | `number` | <div>Yes</div> | The volume level set when the device is turned on. |
|
|
227
304
|
|
|
305
|
+
#### Return value
|
|
306
|
+
|
|
307
|
+
Resolves when the timer is set.
|
|
308
|
+
|
|
309
|
+
#### Possible errors
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
- If the timer type is invalid.
|
|
313
|
+
- If the time format is incorrect.
|
|
314
|
+
- If the weekdays array contains an invalid weekday.
|
|
315
|
+
- If the `volume` parameter is not a number between 0 and 100.
|
|
316
|
+
- If the `timeOn` or `timeOff` parameters do not match the expected time format (`HH:mm:ss`).
|
|
317
|
+
- If the `weekdays` parameter is not an array of strings.
|
|
318
|
+
- If the `type` parameter is not a valid timer type (e.g., `TIMER_1`, `TIMER_2`, ..., `TIMER_7`).
|
|
319
|
+
|
|
228
320
|
#### Example
|
|
229
321
|
|
|
230
322
|
```ts
|
|
231
|
-
await sos.management.power.setTimer("TIMER_1", "08:00", "22:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);
|
|
323
|
+
await sos.management.power.setTimer("TIMER_1", "08:00:00", "22:00:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);
|
|
232
324
|
```
|
|
233
325
|
|
|
326
|
+
:::note[GitHub Example]
|
|
327
|
+
|
|
328
|
+
- [ Applet Example for Native Timers](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/timer)
|
|
329
|
+
|
|
330
|
+
:::
|
|
331
|
+
|
|
234
332
|
<Separator />
|
|
235
333
|
|
|
236
334
|
### systemReboot()
|
|
@@ -241,12 +339,22 @@ The `systemReboot()` method initializes a system reboot.
|
|
|
241
339
|
systemReboot(): Promise<void>;
|
|
242
340
|
```
|
|
243
341
|
|
|
342
|
+
#### Return value
|
|
343
|
+
|
|
344
|
+
Resolves when the system reboot is initiated.
|
|
345
|
+
|
|
244
346
|
#### Example
|
|
245
347
|
|
|
246
348
|
```ts
|
|
247
349
|
await sos.management.power.systemReboot();
|
|
248
350
|
```
|
|
249
351
|
|
|
352
|
+
:::note[GitHub Example]
|
|
353
|
+
|
|
354
|
+
- [ Applet Example for System Reboot](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/system-reboot)
|
|
355
|
+
|
|
356
|
+
:::
|
|
357
|
+
|
|
250
358
|
<Separator />
|
|
251
359
|
|
|
252
360
|
### unsetProprietaryTimer()
|
|
@@ -264,6 +372,14 @@ unsetProprietaryTimer(type: ProprietaryTimerType): Promise<void>;
|
|
|
264
372
|
|--------|---------------------|------------------|----------------------------------------------------|
|
|
265
373
|
| `type` | ``TIMER_${number}`` | <div>Yes</div> | The type of the timer (`TIMER_1`, ..., `TIMER_7`). |
|
|
266
374
|
|
|
375
|
+
#### Return value
|
|
376
|
+
|
|
377
|
+
Resolves when the proprietary timer is removed.
|
|
378
|
+
|
|
379
|
+
#### Possible errors
|
|
380
|
+
|
|
381
|
+
If the timer type is invalid.
|
|
382
|
+
|
|
267
383
|
#### Example
|
|
268
384
|
|
|
269
385
|
```ts
|
|
@@ -286,6 +402,14 @@ unsetTimer(type: keyof typeof TimerType): Promise<void>;
|
|
|
286
402
|
|--------|-------------------------------------------------------------------------------------------|------------------|----------------------------------------------------|
|
|
287
403
|
| `type` | `"TIMER_1" \| "TIMER_2" \| "TIMER_3" \| "TIMER_4" \| "TIMER_5" \| "TIMER_6" \| "TIMER_7"` | <div>Yes</div> | The type of the timer (`TIMER_1`, ..., `TIMER_7`). |
|
|
288
404
|
|
|
405
|
+
#### Return value
|
|
406
|
+
|
|
407
|
+
Resolves when the timer is removed.
|
|
408
|
+
|
|
409
|
+
#### Possible errors
|
|
410
|
+
|
|
411
|
+
If the timer type is invalid.
|
|
412
|
+
|
|
289
413
|
#### Example
|
|
290
414
|
|
|
291
415
|
```ts
|