@signageos/front-applet 8.6.0 → 8.8.0
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 +7 -7
- package/dist/bundle.js.map +1 -1
- package/docs/fpath/index.md +0 -270
- package/docs/sos/browser.md +0 -14
- package/docs/sos/command.md +0 -18
- package/docs/sos/deviceInfo.md +0 -17
- package/docs/sos/display.md +0 -8
- package/docs/sos/fileSystem.md +0 -488
- package/docs/sos/hardware/index.md +2 -49
- package/docs/sos/input.md +0 -12
- package/docs/sos/native/mdc.md +1 -35
- package/docs/sos/native/nmc.md +127 -0
- package/docs/sos/offline/cache.md +0 -6
- package/docs/sos/offline/index.md +0 -27
- package/docs/sos/proofOfPlay.md +0 -10
- package/docs/sos/stream.md +11 -781
- package/docs/sos/sync.md +0 -23
- package/docs/sos/video.md +0 -86
- package/docs/sos_management/app.md +32 -29
- package/docs/sos_management/index.md +2 -10
- package/docs/sos_management/network.md +73 -19
- package/docs/sos_management/os.md +0 -11
- package/docs/sos_management/package.md +20 -0
- package/docs/sos_management/power.md +50 -30
- package/docs/sos_management/screen.md +0 -7
- package/docs/sos_management/time.md +0 -3
- package/docs/sos_management/wifi.md +0 -101
- package/es6/FrontApplet/Management/App/App.d.ts +34 -24
- package/es6/FrontApplet/Management/App/App.js.map +1 -1
- package/es6/FrontApplet/Management/IManagement.d.ts +1 -1
- package/es6/FrontApplet/Management/Network/INetwork.d.ts +2 -0
- package/es6/FrontApplet/Management/Network/INetwork.js.map +1 -1
- package/es6/FrontApplet/Management/Network/Network.d.ts +35 -0
- package/es6/FrontApplet/Management/Network/Network.js +68 -0
- package/es6/FrontApplet/Management/Network/Network.js.map +1 -1
- package/es6/FrontApplet/Management/Network/wakeOnLan.d.ts +18 -0
- package/es6/FrontApplet/Management/Network/wakeOnLan.js +43 -0
- package/es6/FrontApplet/Management/Network/wakeOnLan.js.map +1 -0
- package/es6/FrontApplet/Management/Package/Package.d.ts +9 -0
- package/es6/FrontApplet/Management/Package/Package.js +15 -0
- package/es6/FrontApplet/Management/Package/Package.js.map +1 -1
- package/es6/FrontApplet/Management/Power/IPower.d.ts +32 -10
- package/es6/FrontApplet/Management/Power/IPower.js +3 -0
- package/es6/FrontApplet/Management/Power/IPower.js.map +1 -1
- package/es6/FrontApplet/Management/Power/Power.d.ts +12 -8
- package/es6/FrontApplet/Management/Power/Power.js +23 -32
- package/es6/FrontApplet/Management/Power/Power.js.map +1 -1
- package/es6/FrontApplet/Management/Power/PowerHelper.d.ts +8 -3
- package/es6/FrontApplet/Management/Power/PowerHelper.js +32 -0
- package/es6/FrontApplet/Management/Power/PowerHelper.js.map +1 -1
- package/es6/FrontApplet/Management/helpers/ProprietaryTimerHelper.d.ts +2 -1
- package/es6/FrontApplet/Management/helpers/TimerHelper.d.ts +3 -1
- package/es6/FrontApplet/Management/helpers/TimerHelper.js +2 -0
- package/es6/FrontApplet/Management/helpers/TimerHelper.js.map +1 -1
- package/es6/FrontApplet/NativeCommands/NMC/CommandsNmc.d.ts +4 -0
- package/es6/FrontApplet/NativeCommands/NMC/CommandsNmc.js +66 -0
- package/es6/FrontApplet/NativeCommands/NMC/CommandsNmc.js.map +1 -0
- package/es6/FrontApplet/NativeCommands/NMC/INativeNmcCommands.d.ts +21 -0
- package/es6/FrontApplet/NativeCommands/NMC/INativeNmcCommands.js +3 -0
- package/es6/FrontApplet/NativeCommands/NMC/INativeNmcCommands.js.map +1 -0
- package/es6/FrontApplet/NativeCommands/NMC/Nmc.d.ts +50 -0
- package/es6/FrontApplet/NativeCommands/NMC/Nmc.js +77 -0
- package/es6/FrontApplet/NativeCommands/NMC/Nmc.js.map +1 -0
- package/es6/FrontApplet/NativeCommands/NativeCommands.d.ts +2 -0
- package/es6/FrontApplet/NativeCommands/NativeCommands.js +3 -0
- package/es6/FrontApplet/NativeCommands/NativeCommands.js.map +1 -1
- package/es6/FrontApplet/Video/IOptions.d.ts +5 -0
- package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.js +14 -0
- package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.js.map +1 -1
- package/es6/Monitoring/Management/Network/managementNetworkCommands.d.ts +23 -1
- package/es6/Monitoring/Management/Network/managementNetworkCommands.js +5 -1
- package/es6/Monitoring/Management/Network/managementNetworkCommands.js.map +1 -1
- package/es6/Monitoring/Management/Power/powerCommands.d.ts +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a MAC address string into an array of 6 bytes.
|
|
3
|
+
* Accepts formats: `AA:BB:CC:DD:EE:FF`, `AA-BB-CC-DD-EE-FF`, `AABBCCDDEEFF`.
|
|
4
|
+
*
|
|
5
|
+
* @param macAddress The MAC address string to parse.
|
|
6
|
+
* @returns An array of 6 bytes (numbers 0-255).
|
|
7
|
+
* @throws {Error} If the MAC address format is invalid.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseMacAddress(macAddress: string): number[];
|
|
10
|
+
/**
|
|
11
|
+
* Creates a Wake-on-LAN magic packet for the given MAC address.
|
|
12
|
+
* The packet is 102 bytes: 6 bytes of 0xFF followed by the MAC address repeated 16 times.
|
|
13
|
+
*
|
|
14
|
+
* @param macAddress The target MAC address (formats: `AA:BB:CC:DD:EE:FF`, `AA-BB-CC-DD-EE-FF`, `AABBCCDDEEFF`).
|
|
15
|
+
* @returns The magic packet as a number array (102 bytes, each 0-255).
|
|
16
|
+
* @throws {Error} If the MAC address format is invalid.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createMagicPacket(macAddress: string): number[];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseMacAddress = parseMacAddress;
|
|
4
|
+
exports.createMagicPacket = createMagicPacket;
|
|
5
|
+
const MAC_REGEX = /^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$|^([0-9A-Fa-f]{2}-){5}[0-9A-Fa-f]{2}$|^[0-9A-Fa-f]{12}$/;
|
|
6
|
+
/**
|
|
7
|
+
* Parses a MAC address string into an array of 6 bytes.
|
|
8
|
+
* Accepts formats: `AA:BB:CC:DD:EE:FF`, `AA-BB-CC-DD-EE-FF`, `AABBCCDDEEFF`.
|
|
9
|
+
*
|
|
10
|
+
* @param macAddress The MAC address string to parse.
|
|
11
|
+
* @returns An array of 6 bytes (numbers 0-255).
|
|
12
|
+
* @throws {Error} If the MAC address format is invalid.
|
|
13
|
+
*/
|
|
14
|
+
function parseMacAddress(macAddress) {
|
|
15
|
+
if (!macAddress || !MAC_REGEX.test(macAddress)) {
|
|
16
|
+
throw new Error(`Invalid MAC address: "${macAddress}". Expected format: AA:BB:CC:DD:EE:FF, AA-BB-CC-DD-EE-FF, or AABBCCDDEEFF`);
|
|
17
|
+
}
|
|
18
|
+
const hex = macAddress.replace(/[:-]/g, '');
|
|
19
|
+
const bytes = [];
|
|
20
|
+
for (let i = 0; i < 12; i += 2) {
|
|
21
|
+
bytes.push(parseInt(hex.substring(i, i + 2), 16));
|
|
22
|
+
}
|
|
23
|
+
return bytes;
|
|
24
|
+
}
|
|
25
|
+
const MAGIC_PACKET_HEADER = [0xff, 0xff, 0xff, 0xff, 0xff, 0xff];
|
|
26
|
+
const MAC_REPETITIONS = 16;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a Wake-on-LAN magic packet for the given MAC address.
|
|
29
|
+
* The packet is 102 bytes: 6 bytes of 0xFF followed by the MAC address repeated 16 times.
|
|
30
|
+
*
|
|
31
|
+
* @param macAddress The target MAC address (formats: `AA:BB:CC:DD:EE:FF`, `AA-BB-CC-DD-EE-FF`, `AABBCCDDEEFF`).
|
|
32
|
+
* @returns The magic packet as a number array (102 bytes, each 0-255).
|
|
33
|
+
* @throws {Error} If the MAC address format is invalid.
|
|
34
|
+
*/
|
|
35
|
+
function createMagicPacket(macAddress) {
|
|
36
|
+
const macBytes = parseMacAddress(macAddress);
|
|
37
|
+
const packet = [...MAGIC_PACKET_HEADER];
|
|
38
|
+
for (let i = 0; i < MAC_REPETITIONS; i++) {
|
|
39
|
+
packet.push(...macBytes);
|
|
40
|
+
}
|
|
41
|
+
return packet;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=wakeOnLan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wakeOnLan.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Network/wakeOnLan.ts"],"names":[],"mappings":";;AAUA,0CAYC;AAaD,8CASC;AA5CD,MAAM,SAAS,GAAG,6FAA6F,CAAC;AAEhH;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,UAAkB;IACjD,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,yBAAyB,UAAU,2EAA2E,CAAC,CAAC;IACjI,CAAC;IAED,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACjE,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,UAAkB;IACnD,MAAM,QAAQ,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAE7C,MAAM,MAAM,GAAa,CAAC,GAAG,mBAAmB,CAAC,CAAC;IAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -41,5 +41,14 @@ export default class Package implements IPackage {
|
|
|
41
41
|
* @since 8.2.0
|
|
42
42
|
*/
|
|
43
43
|
stop(packageName: string): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* The `clearData()` method stops a certain package and clears its user data.
|
|
46
|
+
*
|
|
47
|
+
* @param packageName Name of the android package
|
|
48
|
+
*
|
|
49
|
+
* @returns {Promise<void>} Resolves if the package data was cleared.
|
|
50
|
+
* @since 8.8.0
|
|
51
|
+
*/
|
|
52
|
+
clearData(packageName: string): Promise<void>;
|
|
44
53
|
private getMessage;
|
|
45
54
|
}
|
|
@@ -67,6 +67,21 @@ class Package {
|
|
|
67
67
|
});
|
|
68
68
|
return stopped;
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* The `clearData()` method stops a certain package and clears its user data.
|
|
72
|
+
*
|
|
73
|
+
* @param packageName Name of the android package
|
|
74
|
+
*
|
|
75
|
+
* @returns {Promise<void>} Resolves if the package data was cleared.
|
|
76
|
+
* @since 8.8.0
|
|
77
|
+
*/
|
|
78
|
+
async clearData(packageName) {
|
|
79
|
+
(0, Validate_1.default)({ packageName }).required().string();
|
|
80
|
+
await this.postMessage({
|
|
81
|
+
type: this.getMessage('clear_package_data'),
|
|
82
|
+
packageName,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
70
85
|
getMessage(name) {
|
|
71
86
|
return this.messagePrefix + '.' + name;
|
|
72
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Package.js","sourceRoot":"","sources":["../../../../src/FrontApplet/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G,MAAM,IAAI,CAAC,WAAW,CAAC;YAC1C,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC;YACrC,WAAW;SACX,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IAChB,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,SAAS,CAAC,WAAmB;QACzC,IAAA,kBAAQ,EAAC,EAAE,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC;QAC9C,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;YAC3C,WAAW;SACX,CAAC,CAAC;IACJ,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC;IACxC,CAAC;CACD;AAvED,0BAuEC"}
|
|
@@ -1,25 +1,41 @@
|
|
|
1
1
|
import { ITimer, TimerType } from '../helpers/TimerHelper';
|
|
2
2
|
import { IProprietaryTimer, ProprietaryTimerType } from '../helpers/ProprietaryTimerHelper';
|
|
3
|
+
import { AnyString } from '../../../utils/types';
|
|
4
|
+
/** @deprecated Use IScheduledRebootAction instead */
|
|
5
|
+
export type IScheduledRebootActions<TRule extends IScheduledRebootRuleRaw | IScheduledRebootRule> = IScheduledRebootAction<TRule>;
|
|
3
6
|
/**
|
|
4
7
|
* Interface representing the scheduled reboot action.
|
|
5
8
|
*/
|
|
6
|
-
export interface
|
|
9
|
+
export interface IScheduledRebootAction<TRule extends IScheduledRebootRuleRaw | IScheduledRebootRule> {
|
|
7
10
|
/** Random generated ID for the scheduled reboot action */
|
|
8
11
|
id: string;
|
|
9
12
|
/** The rule of the scheduled reboot */
|
|
10
|
-
rule:
|
|
13
|
+
rule: TRule;
|
|
11
14
|
}
|
|
12
|
-
|
|
15
|
+
/** @internal */
|
|
16
|
+
export interface IScheduledRebootRuleRaw {
|
|
13
17
|
/** Weekdays as numbers or strings. Number types are received from server. */
|
|
14
|
-
weekdays:
|
|
18
|
+
weekdays: WeekdayNumberType[];
|
|
15
19
|
/** Time in HH:mm:ss format */
|
|
16
20
|
time: string;
|
|
17
21
|
}
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
export interface IScheduledRebootRule {
|
|
23
|
+
/** @deprecated use shortWeekdays property */
|
|
24
|
+
weekdays: WeekdayType[];
|
|
25
|
+
shortWeekdays: ShortWeekdayType[];
|
|
26
|
+
time: string;
|
|
27
|
+
}
|
|
28
|
+
export type ShortWeekdayType = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
|
|
29
|
+
/**
|
|
30
|
+
* Allowed scheduled action weekday types
|
|
31
|
+
* @deprecated Use ShortWeekdayType instead
|
|
32
|
+
*/
|
|
33
|
+
export type WeekdayType = 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY';
|
|
20
34
|
/**
|
|
21
35
|
* This enum is necessary to convert between the number representation of the weekday and the string representation.
|
|
22
36
|
* On device and servers values are stored as numbers, but in the JS API, we use strings for better human friendly values.
|
|
37
|
+
*
|
|
38
|
+
* @deprecated Use ShortWeekdayType instead
|
|
23
39
|
*/
|
|
24
40
|
export declare enum WeekdayNumbered {
|
|
25
41
|
SUNDAY = 0,
|
|
@@ -30,6 +46,9 @@ export declare enum WeekdayNumbered {
|
|
|
30
46
|
FRIDAY = 5,
|
|
31
47
|
SATURDAY = 6
|
|
32
48
|
}
|
|
49
|
+
/** @deprecated Use ShortWeekdayType instead */
|
|
50
|
+
export type WeekdayNumberType = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
51
|
+
/** @deprecated Use ShortWeekdayType instead */
|
|
33
52
|
export declare enum WeekdayNamed {
|
|
34
53
|
SUNDAY = "SUNDAY",
|
|
35
54
|
MONDAY = "MONDAY",
|
|
@@ -43,13 +62,16 @@ export default interface IPower {
|
|
|
43
62
|
systemReboot(): Promise<void>;
|
|
44
63
|
appRestart(): Promise<void>;
|
|
45
64
|
getTimers(): Promise<ITimer[]>;
|
|
46
|
-
setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays:
|
|
65
|
+
setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
66
|
+
volume: number): Promise<void>;
|
|
47
67
|
unsetTimer(type: keyof typeof TimerType): Promise<void>;
|
|
48
68
|
getProprietaryTimers(): Promise<IProprietaryTimer[]>;
|
|
49
|
-
setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff: string | null, weekdays:
|
|
69
|
+
setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff: string | null, weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
70
|
+
keepAppletRunning?: boolean): Promise<void>;
|
|
50
71
|
unsetProprietaryTimer(type: ProprietaryTimerType): Promise<void>;
|
|
51
|
-
setScheduledReboot(weekdays:
|
|
72
|
+
setScheduledReboot(weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
73
|
+
time: string): Promise<void>;
|
|
52
74
|
removeScheduledReboot(id: string): Promise<void>;
|
|
53
|
-
getScheduledReboots(): Promise<
|
|
75
|
+
getScheduledReboots(): Promise<IScheduledRebootAction<IScheduledRebootRule>[]>;
|
|
54
76
|
clearScheduledReboots(): Promise<void>;
|
|
55
77
|
}
|
|
@@ -4,6 +4,8 @@ exports.WeekdayNamed = exports.WeekdayNumbered = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* This enum is necessary to convert between the number representation of the weekday and the string representation.
|
|
6
6
|
* On device and servers values are stored as numbers, but in the JS API, we use strings for better human friendly values.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Use ShortWeekdayType instead
|
|
7
9
|
*/
|
|
8
10
|
var WeekdayNumbered;
|
|
9
11
|
(function (WeekdayNumbered) {
|
|
@@ -15,6 +17,7 @@ var WeekdayNumbered;
|
|
|
15
17
|
WeekdayNumbered[WeekdayNumbered["FRIDAY"] = 5] = "FRIDAY";
|
|
16
18
|
WeekdayNumbered[WeekdayNumbered["SATURDAY"] = 6] = "SATURDAY";
|
|
17
19
|
})(WeekdayNumbered || (exports.WeekdayNumbered = WeekdayNumbered = {}));
|
|
20
|
+
/** @deprecated Use ShortWeekdayType instead */
|
|
18
21
|
var WeekdayNamed;
|
|
19
22
|
(function (WeekdayNamed) {
|
|
20
23
|
WeekdayNamed["SUNDAY"] = "SUNDAY";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPower.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/IPower.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"IPower.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/IPower.ts"],"names":[],"mappings":";;;AA6CA;;;;;GAKG;AACH,IAAY,eAQX;AARD,WAAY,eAAe;IAC1B,yDAAU,CAAA;IACV,yDAAU,CAAA;IACV,2DAAW,CAAA;IACX,+DAAa,CAAA;IACb,6DAAY,CAAA;IACZ,yDAAU,CAAA;IACV,6DAAY,CAAA;AACb,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAKD,+CAA+C;AAC/C,IAAY,YAQX;AARD,WAAY,YAAY;IACvB,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;AACtB,CAAC,EARW,YAAY,4BAAZ,YAAY,QAQvB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { AnyString } from '../../../utils/types';
|
|
1
2
|
import IPostMessage from '../../IPostMessage';
|
|
2
|
-
import { ITimer, TimerType } from '../helpers/TimerHelper';
|
|
3
3
|
import { IProprietaryTimer, ProprietaryTimerType } from '../helpers/ProprietaryTimerHelper';
|
|
4
|
-
import
|
|
4
|
+
import { ITimer, TimerType } from '../helpers/TimerHelper';
|
|
5
|
+
import IPower, { IScheduledRebootAction, IScheduledRebootRule, ShortWeekdayType } from './IPower';
|
|
5
6
|
/**
|
|
6
7
|
* The `sos.management.power` API groups together methods related to the power state of the device. Such as rebooting, shutting down,
|
|
7
8
|
* setting timers.
|
|
@@ -62,7 +63,7 @@ export default class Power implements IPower {
|
|
|
62
63
|
* @param type The type of the timer (`TIMER_1`, ..., `TIMER_7`).
|
|
63
64
|
* @param timeOn The time when the device should turn on.
|
|
64
65
|
* @param timeOff The time when the device should turn off.
|
|
65
|
-
* @param weekdays The days of the week when the timer should be active (`mon`, ..., `sun`).
|
|
66
|
+
* @param {ShortWeekdayType} weekdays The days of the week when the timer should be active (`mon`, ..., `sun`).
|
|
66
67
|
* @param volume The volume level set when the device is turned on.
|
|
67
68
|
* @return {Promise<void>} Resolves when the timer is set.
|
|
68
69
|
* @throws {Error} If the timer type is invalid.
|
|
@@ -79,7 +80,8 @@ export default class Power implements IPower {
|
|
|
79
80
|
* @example
|
|
80
81
|
* await sos.management.power.setTimer("TIMER_1", "08:00:00", "22:00:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);
|
|
81
82
|
*/
|
|
82
|
-
setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays:
|
|
83
|
+
setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
84
|
+
volume: number): Promise<void>;
|
|
83
85
|
/**
|
|
84
86
|
* The `unsetTimer()` method removes the specified native timer.
|
|
85
87
|
*
|
|
@@ -127,7 +129,8 @@ export default class Power implements IPower {
|
|
|
127
129
|
* @example
|
|
128
130
|
* await sos.management.power.setProprietaryTimer("TIMER_2", "08:00:00", "22:00:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], false);
|
|
129
131
|
*/
|
|
130
|
-
setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff: string | null, weekdays:
|
|
132
|
+
setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff: string | null, weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
133
|
+
keepAppletRunning?: boolean): Promise<void>;
|
|
131
134
|
/**
|
|
132
135
|
* The `unsetProprietaryTimer()` method removes the specified
|
|
133
136
|
* [proprietary timer](https://docs.signageos.io/hc/en-us/articles/4416384202642-Timers#h_01HCD14GEDP96AZV58NRSN2HNQ).
|
|
@@ -154,13 +157,13 @@ export default class Power implements IPower {
|
|
|
154
157
|
/**
|
|
155
158
|
* Returns all scheduled reboot rules on the device set by the `setScheduledReboot()` method.
|
|
156
159
|
*
|
|
157
|
-
* @returns {Promise<
|
|
160
|
+
* @returns {Promise<IScheduledRebootAction[]>} Resolves with an array of scheduled reboot actions.
|
|
158
161
|
* @since 8.1.0
|
|
159
162
|
*
|
|
160
163
|
* @example
|
|
161
164
|
* await sos.management.power.getScheduledReboots();
|
|
162
165
|
*/
|
|
163
|
-
getScheduledReboots(): Promise<
|
|
166
|
+
getScheduledReboots(): Promise<IScheduledRebootAction<IScheduledRebootRule>[]>;
|
|
164
167
|
/**
|
|
165
168
|
* Removes scheduled reboot rule from the device (if it exists).
|
|
166
169
|
* @param id {string} ID of the rule to be removed.
|
|
@@ -202,6 +205,7 @@ export default class Power implements IPower {
|
|
|
202
205
|
* // Schedule reboot every Monday and Friday at 7:30 PM / 19:30
|
|
203
206
|
* await sos.management.power.setScheduledReboot(["MONDAY", "FRIDAY"], "19:30:00");
|
|
204
207
|
*/
|
|
205
|
-
setScheduledReboot(weekdays:
|
|
208
|
+
setScheduledReboot(weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
209
|
+
time: string): Promise<void>;
|
|
206
210
|
private getMessage;
|
|
207
211
|
}
|
|
@@ -3,9 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const TimerHelper_1 = require("../helpers/TimerHelper");
|
|
7
6
|
const Validate_1 = __importDefault(require("../../Validate/Validate"));
|
|
8
|
-
const
|
|
7
|
+
const TimerHelper_1 = require("../helpers/TimerHelper");
|
|
9
8
|
const PowerHelper_1 = require("./PowerHelper");
|
|
10
9
|
/**
|
|
11
10
|
* The `sos.management.power` API groups together methods related to the power state of the device. Such as rebooting, shutting down,
|
|
@@ -83,7 +82,7 @@ class Power {
|
|
|
83
82
|
* @param type The type of the timer (`TIMER_1`, ..., `TIMER_7`).
|
|
84
83
|
* @param timeOn The time when the device should turn on.
|
|
85
84
|
* @param timeOff The time when the device should turn off.
|
|
86
|
-
* @param weekdays The days of the week when the timer should be active (`mon`, ..., `sun`).
|
|
85
|
+
* @param {ShortWeekdayType} weekdays The days of the week when the timer should be active (`mon`, ..., `sun`).
|
|
87
86
|
* @param volume The volume level set when the device is turned on.
|
|
88
87
|
* @return {Promise<void>} Resolves when the timer is set.
|
|
89
88
|
* @throws {Error} If the timer type is invalid.
|
|
@@ -100,7 +99,8 @@ class Power {
|
|
|
100
99
|
* @example
|
|
101
100
|
* await sos.management.power.setTimer("TIMER_1", "08:00:00", "22:00:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);
|
|
102
101
|
*/
|
|
103
|
-
async setTimer(type, timeOn, timeOff, weekdays,
|
|
102
|
+
async setTimer(type, timeOn, timeOff, weekdays, // TODO: remove AnyString in the next major release
|
|
103
|
+
volume) {
|
|
104
104
|
if (typeof TimerHelper_1.TimerType[type] === 'undefined') {
|
|
105
105
|
throw new Error('Invalid timer type');
|
|
106
106
|
}
|
|
@@ -118,17 +118,13 @@ class Power {
|
|
|
118
118
|
.timerTime();
|
|
119
119
|
(0, Validate_1.default)({ weekdays }).required().array('string');
|
|
120
120
|
(0, Validate_1.default)({ volume }).required().number().min(0).max(100);
|
|
121
|
-
|
|
122
|
-
if (typeof TimerHelper_1.TimerWeekday[weekday] === 'undefined') {
|
|
123
|
-
throw new Error('Invalid timer weekday');
|
|
124
|
-
}
|
|
125
|
-
}
|
|
121
|
+
const shortWeekdays = weekdays.map(PowerHelper_1.coalesceWeekdayType);
|
|
126
122
|
await this.postMessage({
|
|
127
123
|
type: this.getMessage('set_timer'),
|
|
128
124
|
timerType: type,
|
|
129
125
|
timeOn,
|
|
130
126
|
timeOff,
|
|
131
|
-
weekdays,
|
|
127
|
+
weekdays: shortWeekdays,
|
|
132
128
|
volume,
|
|
133
129
|
});
|
|
134
130
|
}
|
|
@@ -189,7 +185,8 @@ class Power {
|
|
|
189
185
|
* @example
|
|
190
186
|
* await sos.management.power.setProprietaryTimer("TIMER_2", "08:00:00", "22:00:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], false);
|
|
191
187
|
*/
|
|
192
|
-
async setProprietaryTimer(type, timeOn, timeOff, weekdays,
|
|
188
|
+
async setProprietaryTimer(type, timeOn, timeOff, weekdays, // TODO: remove AnyString in the next major release
|
|
189
|
+
keepAppletRunning = false) {
|
|
193
190
|
(0, Validate_1.default)({ type })
|
|
194
191
|
.required()
|
|
195
192
|
.string()
|
|
@@ -208,17 +205,13 @@ class Power {
|
|
|
208
205
|
.timerTime();
|
|
209
206
|
(0, Validate_1.default)({ weekdays }).required().array('string');
|
|
210
207
|
(0, Validate_1.default)({ keepAppletRunning }).required().boolean();
|
|
211
|
-
|
|
212
|
-
if (typeof TimerHelper_1.TimerWeekday[weekday] === 'undefined') {
|
|
213
|
-
throw new Error('Invalid timer weekday');
|
|
214
|
-
}
|
|
215
|
-
}
|
|
208
|
+
const shortWeekdays = weekdays.map(PowerHelper_1.coalesceWeekdayType);
|
|
216
209
|
await this.postMessage({
|
|
217
210
|
type: this.getMessage('set_proprietary_timer'),
|
|
218
211
|
timerType: type,
|
|
219
212
|
timeOn,
|
|
220
213
|
timeOff,
|
|
221
|
-
weekdays,
|
|
214
|
+
weekdays: shortWeekdays,
|
|
222
215
|
keepAppletRunning,
|
|
223
216
|
});
|
|
224
217
|
}
|
|
@@ -264,7 +257,7 @@ class Power {
|
|
|
264
257
|
/**
|
|
265
258
|
* Returns all scheduled reboot rules on the device set by the `setScheduledReboot()` method.
|
|
266
259
|
*
|
|
267
|
-
* @returns {Promise<
|
|
260
|
+
* @returns {Promise<IScheduledRebootAction[]>} Resolves with an array of scheduled reboot actions.
|
|
268
261
|
* @since 8.1.0
|
|
269
262
|
*
|
|
270
263
|
* @example
|
|
@@ -275,12 +268,15 @@ class Power {
|
|
|
275
268
|
type: this.getMessage('get_scheduled_reboots'),
|
|
276
269
|
});
|
|
277
270
|
// We need to convert the values of days back to a string representation
|
|
278
|
-
|
|
279
|
-
action
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
271
|
+
const outputActions = actions.map((action) => ({
|
|
272
|
+
...action,
|
|
273
|
+
rule: {
|
|
274
|
+
...action.rule,
|
|
275
|
+
weekdays: action.rule.weekdays.map(PowerHelper_1.convertNumberToWeekday),
|
|
276
|
+
shortWeekdays: action.rule.weekdays.map(PowerHelper_1.coalesceWeekdayType),
|
|
277
|
+
},
|
|
278
|
+
}));
|
|
279
|
+
return outputActions;
|
|
284
280
|
}
|
|
285
281
|
/**
|
|
286
282
|
* Removes scheduled reboot rule from the device (if it exists).
|
|
@@ -329,16 +325,11 @@ class Power {
|
|
|
329
325
|
* // Schedule reboot every Monday and Friday at 7:30 PM / 19:30
|
|
330
326
|
* await sos.management.power.setScheduledReboot(["MONDAY", "FRIDAY"], "19:30:00");
|
|
331
327
|
*/
|
|
332
|
-
async setScheduledReboot(weekdays,
|
|
328
|
+
async setScheduledReboot(weekdays, // TODO: remove AnyString in the next major release
|
|
329
|
+
time) {
|
|
333
330
|
(0, Validate_1.default)({ weekdays }).required().array('string');
|
|
334
|
-
// Validate if day is in weekday enum
|
|
335
|
-
for (const weekday of weekdays) {
|
|
336
|
-
if (typeof IPower_1.WeekdayNamed[weekday] === 'undefined') {
|
|
337
|
-
throw new Error('Invalid weekday');
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
331
|
// Days in week need to be converted to specific numbers to work properly
|
|
341
|
-
const weekdayAsNumbers = weekdays.map(PowerHelper_1.
|
|
332
|
+
const weekdayAsNumbers = weekdays.map(PowerHelper_1.convertBCWeekdayToNumber);
|
|
342
333
|
(0, Validate_1.default)({ time })
|
|
343
334
|
.required()
|
|
344
335
|
.string()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Power.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/Power.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"Power.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/Power.ts"],"names":[],"mappings":";;;;;AAEA,uEAA+C;AAE/C,wDAA2D;AAE3D,+CAAsG;AAEtG;;;;;;;;;;;;;;;;GAgBG;AACH,MAAqB,KAAK;IAGhB;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ;;;;;;;;;;OAUG;IACI,KAAK,CAAC,YAAY;QACxB,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;SACtC,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,UAAU;QACtB,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;SACpC,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,SAAS;QACrB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;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IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC;IACxC,CAAC;CACD;AAtWD,wBAsWC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { AnyString } from '../../../utils/types';
|
|
2
|
+
import { ShortWeekdayType, WeekdayNumbered, WeekdayNumberType, WeekdayType } from './IPower';
|
|
3
|
+
export type BackwardsCompatibleWeekdayType = WeekdayType | ShortWeekdayType | WeekdayNumberType | AnyString;
|
|
4
|
+
export declare const SHORT_WEEKDAYS: readonly ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
|
5
|
+
export declare function convertWeekdayToNumber(weekday: WeekdayType): WeekdayNumberType;
|
|
6
|
+
export declare function convertBCWeekdayToNumber(weekday: BackwardsCompatibleWeekdayType): WeekdayNumberType;
|
|
7
|
+
export declare function convertNumberToWeekday(weekday: number): keyof typeof WeekdayNumbered;
|
|
8
|
+
export declare const coalesceWeekdayType: (weekday: BackwardsCompatibleWeekdayType) => ShortWeekdayType;
|
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.coalesceWeekdayType = exports.SHORT_WEEKDAYS = void 0;
|
|
3
4
|
exports.convertWeekdayToNumber = convertWeekdayToNumber;
|
|
5
|
+
exports.convertBCWeekdayToNumber = convertBCWeekdayToNumber;
|
|
4
6
|
exports.convertNumberToWeekday = convertNumberToWeekday;
|
|
7
|
+
const TimerHelper_1 = require("../helpers/TimerHelper");
|
|
5
8
|
const IPower_1 = require("./IPower");
|
|
9
|
+
exports.SHORT_WEEKDAYS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
|
6
10
|
function convertWeekdayToNumber(weekday) {
|
|
7
11
|
return IPower_1.WeekdayNumbered[weekday];
|
|
8
12
|
}
|
|
13
|
+
function convertBCWeekdayToNumber(weekday) {
|
|
14
|
+
const short = (0, exports.coalesceWeekdayType)(weekday);
|
|
15
|
+
return TimerHelper_1.TimerWeekday[short];
|
|
16
|
+
}
|
|
9
17
|
function convertNumberToWeekday(weekday) {
|
|
10
18
|
return IPower_1.WeekdayNumbered[weekday];
|
|
11
19
|
}
|
|
20
|
+
const coalesceWeekdayType = (weekday) => {
|
|
21
|
+
if (isShortWeekdayType(weekday)) {
|
|
22
|
+
return weekday;
|
|
23
|
+
}
|
|
24
|
+
if (isWeekdayType(weekday)) {
|
|
25
|
+
return {
|
|
26
|
+
MONDAY: 'mon',
|
|
27
|
+
TUESDAY: 'tue',
|
|
28
|
+
WEDNESDAY: 'wed',
|
|
29
|
+
THURSDAY: 'thu',
|
|
30
|
+
FRIDAY: 'fri',
|
|
31
|
+
SATURDAY: 'sat',
|
|
32
|
+
SUNDAY: 'sun',
|
|
33
|
+
}[weekday];
|
|
34
|
+
}
|
|
35
|
+
if (isWeekdayNumberType(weekday)) {
|
|
36
|
+
return exports.SHORT_WEEKDAYS[weekday];
|
|
37
|
+
}
|
|
38
|
+
throw new Error(`Unknown week day value "${weekday}"`);
|
|
39
|
+
};
|
|
40
|
+
exports.coalesceWeekdayType = coalesceWeekdayType;
|
|
41
|
+
const isShortWeekdayType = (weekday) => exports.SHORT_WEEKDAYS.includes(weekday);
|
|
42
|
+
const isWeekdayType = (weekday) => weekday in IPower_1.WeekdayNamed;
|
|
43
|
+
const isWeekdayNumberType = (weekday) => typeof weekday === 'number' && weekday >= 0 && weekday <= 6;
|
|
12
44
|
//# sourceMappingURL=PowerHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerHelper.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/PowerHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PowerHelper.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/PowerHelper.ts"],"names":[],"mappings":";;;AAQA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O,CAAC,CAAC;AAE1D,MAAM,aAAa,GAAG,CAAC,OAAuC,EAA0B,EAAE,CAAC,OAAO,IAAI,qBAAY,CAAC;AAEnH,MAAM,mBAAmB,GAAG,CAAC,OAAuC,EAAgC,EAAE,CACrG,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { ShortWeekdayType } from '../Power/IPower';
|
|
1
2
|
export type ProprietaryTimerType = `TIMER_${number}`;
|
|
2
3
|
export interface IProprietaryTimer {
|
|
3
4
|
type: ProprietaryTimerType;
|
|
4
5
|
timeOn: string | null;
|
|
5
6
|
timeOff: string | null;
|
|
6
|
-
weekdays:
|
|
7
|
+
weekdays: ShortWeekdayType[];
|
|
7
8
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ShortWeekdayType } from '../Power/IPower';
|
|
1
2
|
export declare enum TimerType {
|
|
2
3
|
TIMER_1 = 0,
|
|
3
4
|
TIMER_2 = 1,
|
|
@@ -7,6 +8,7 @@ export declare enum TimerType {
|
|
|
7
8
|
TIMER_6 = 5,
|
|
8
9
|
TIMER_7 = 6
|
|
9
10
|
}
|
|
11
|
+
/** @deprecated use ShortWeekdayType instead */
|
|
10
12
|
export declare enum TimerWeekday {
|
|
11
13
|
sun = 0,
|
|
12
14
|
mon = 1,
|
|
@@ -20,6 +22,6 @@ export interface ITimer {
|
|
|
20
22
|
type: keyof typeof TimerType;
|
|
21
23
|
timeOn: string | null;
|
|
22
24
|
timeOff: string | null;
|
|
23
|
-
weekdays:
|
|
25
|
+
weekdays: ShortWeekdayType[];
|
|
24
26
|
volume: number;
|
|
25
27
|
}
|
|
@@ -11,6 +11,8 @@ var TimerType;
|
|
|
11
11
|
TimerType[TimerType["TIMER_6"] = 5] = "TIMER_6";
|
|
12
12
|
TimerType[TimerType["TIMER_7"] = 6] = "TIMER_7";
|
|
13
13
|
})(TimerType || (exports.TimerType = TimerType = {}));
|
|
14
|
+
// TODO: remove in the next major release
|
|
15
|
+
/** @deprecated use ShortWeekdayType instead */
|
|
14
16
|
var TimerWeekday;
|
|
15
17
|
(function (TimerWeekday) {
|
|
16
18
|
TimerWeekday[TimerWeekday["sun"] = 0] = "sun";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimerHelper.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/helpers/TimerHelper.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"TimerHelper.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/helpers/TimerHelper.ts"],"names":[],"mappings":";;;AAEA,IAAY,SAQX;AARD,WAAY,SAAS;IACpB,+CAAW,CAAA;IACX,+CAAW,CAAA;IACX,+CAAW,CAAA;IACX,+CAAW,CAAA;IACX,+CAAW,CAAA;IACX,+CAAW,CAAA;IACX,+CAAW,CAAA;AACZ,CAAC,EARW,SAAS,yBAAT,SAAS,QAQpB;AAED,yCAAyC;AACzC,+CAA+C;AAC/C,IAAY,YAQX;AARD,WAAY,YAAY;IACvB,6CAAO,CAAA;IACP,6CAAO,CAAA;IACP,6CAAO,CAAA;IACP,6CAAO,CAAA;IACP,6CAAO,CAAA;IACP,6CAAO,CAAA;IACP,6CAAO,CAAA;AACR,CAAC,EARW,YAAY,4BAAZ,YAAY,QAQvB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NmcCommands = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Available NMC commands for WebOS devices.
|
|
6
|
+
*/
|
|
7
|
+
exports.NmcCommands = [
|
|
8
|
+
['k', 'a'], // Power
|
|
9
|
+
['k', 'b'], // Input Select
|
|
10
|
+
['k', 'c'], // Aspect Ratio
|
|
11
|
+
['k', 'd'], // Screen Mute
|
|
12
|
+
['k', 'e'], // Volume Mute
|
|
13
|
+
['k', 'f'], // Volume Control
|
|
14
|
+
['k', 'g'], // Contrast
|
|
15
|
+
['k', 'h'], // Brightness
|
|
16
|
+
['k', 'i'], // Color
|
|
17
|
+
['k', 'j'], // Tint
|
|
18
|
+
['k', 'k'], // Sharpness
|
|
19
|
+
['k', 'l'], // OSD Select
|
|
20
|
+
['k', 'm'], // Remote Lock/Key Lock
|
|
21
|
+
['k', 't'], // Balance
|
|
22
|
+
['k', 'u'], // Color Temperature
|
|
23
|
+
['k', 'z'], // Abnormal state
|
|
24
|
+
['j', 'p'], // ISM mode
|
|
25
|
+
['j', 'u'], // Auto configuration
|
|
26
|
+
['m', 'c'], // Key
|
|
27
|
+
['d', 'd'], // Tile Mode
|
|
28
|
+
['d', 'e'], // Tile H Position
|
|
29
|
+
['d', 'f'], // Tile V Position
|
|
30
|
+
['d', 'g'], // Tile H Size
|
|
31
|
+
['d', 'h'], // Tile V Size
|
|
32
|
+
['d', 'i'], // Tile ID Set
|
|
33
|
+
['d', 'j'], // Natural Mode (In Tile mode)
|
|
34
|
+
['d', 'x'], // Picture Mode (PSM)
|
|
35
|
+
['d', 'y'], // Sound Mode
|
|
36
|
+
['d', 'w'], // Fan Fault check
|
|
37
|
+
['d', 'l'], // Elapsed time return
|
|
38
|
+
['d', 'n'], // Temperature value
|
|
39
|
+
['d', 'd'], // Lamp fault check
|
|
40
|
+
['d', 'u'], // Auto Volume
|
|
41
|
+
['d', 'v'], // Speak
|
|
42
|
+
['f', 'a'], // Time
|
|
43
|
+
['f', 'd'], // On Timer(On/Off Timer)Time
|
|
44
|
+
['f', 'e'], // Off Timer(On/Off Timer) Time
|
|
45
|
+
['f', 'u'], // Scheduling Input Select
|
|
46
|
+
['f', 'f'], // Sleep Time
|
|
47
|
+
['f', 'g'], // Auto Sleep
|
|
48
|
+
['f', 'h'], // Power On Delay
|
|
49
|
+
['f', 'i'], // Language
|
|
50
|
+
['f', 'j'], // DPM Select
|
|
51
|
+
['f', 'k'], // Reset
|
|
52
|
+
['f', 'l'], // Power Saving
|
|
53
|
+
['f', 'o'], // Power Indicator
|
|
54
|
+
['f', 'p'], // Logo Indicator
|
|
55
|
+
['f', 'y'], // Serial no
|
|
56
|
+
['f', 'z'], // S/W Version
|
|
57
|
+
['x', 'b'], // Input Select
|
|
58
|
+
['f', '#'], // USB Connection Check
|
|
59
|
+
['f', '#'], // USB File List Count.
|
|
60
|
+
['f', '#'], // USB Get File Info.
|
|
61
|
+
['f', '#'], // USB Media Control
|
|
62
|
+
['f', '#'], // USB Add Play List
|
|
63
|
+
['f', '#'], // USB Add Schedule
|
|
64
|
+
['f', '#'], // USB Set Schedule
|
|
65
|
+
][0];
|
|
66
|
+
//# sourceMappingURL=CommandsNmc.js.map
|