Skip to content

multiple line output when execute script #3

@sl1pkn07

Description

@sl1pkn07

script

const hyperxCloudFlight = require('hyperx-cloud-flight-wireless')()

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', (percentage) =>  console.log(`current battery: ${percentage}%`))
hyperxCloudFlight.on('unknown', (data) => console.log('unknown', data))
hyperxCloudFlight.on('error', (error) => console.error('error', error))

output:

└───╼  NODE_PATH=$(npm root -g) node cloud_flight.js 
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%
current battery: 100%

linux node 16.3.0
greetings

PS: the udev rule is wrong for me (archlinux). fixed with

KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0951", ATTRS{idProduct}=="16c4", MODE="0666", TAG+="uaccess"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions