-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtestscript.ts
More file actions
30 lines (29 loc) · 736 Bytes
/
testscript.ts
File metadata and controls
30 lines (29 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* eslint-disable no-constant-condition */
/* eslint-disable no-empty */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable no-console */
/* eslint-disable no-await-in-loop */
import {
apiVersion,
open,
OSDAlarms,
ports,
readOSDConfig,
writeOSDAlarm,
} from "./src";
(async () => {
console.log(await ports());
const port = (await ports())[2]!.path;
await open(port);
console.log(apiVersion(port));
const config = await readOSDConfig(port);
const before = config.alarms;
console.log(before);
await writeOSDAlarm(port, {
key: OSDAlarms.RSSI,
value: 69,
});
const afterConfig = await readOSDConfig(port);
const after = afterConfig.alarms;
console.log(after);
})();