forked from srn/hyperx-cloud-flight-wireless
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.js
More file actions
14 lines (13 loc) · 817 Bytes
/
Copy pathtest.js
File metadata and controls
14 lines (13 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Example: read events from the headset in the console
const hyperxCloudFlight = require('./')({
debug: false,
// at most one identical battery emission per minute if the value doesn't change
batteryMinIntervalMs: 60_000,
});
hyperxCloudFlight.on('power', (power) => console.log(`power: ${power}`));
hyperxCloudFlight.on('muted', (status) => console.log(`muted: ${status}`));
hyperxCloudFlight.on('volume', (direction) => console.log(`volume: ${direction}`));
hyperxCloudFlight.on('charging', (charging) => console.log(`charging: ${charging}`));
hyperxCloudFlight.on('battery', (pct) => console.log(`current battery: ${pct}%`));
hyperxCloudFlight.on('unknown', (data) => console.log('unknown', data));
hyperxCloudFlight.on('error', (err) => console.error('error', err));