Dateien hochladen nach „config“

main
Theenoro 2023-03-10 14:27:11 +01:00
parent 58e8ca4110
commit 16daa2723a
2 changed files with 52 additions and 0 deletions

38
config/index.js 100644
View File

@ -0,0 +1,38 @@
const { Client } = require("openrgb-sdk")
const flags = require("./config/flags.js")
const ms = 1000;
let client;
async function start () {
client = new Client("Example", 6742, "localhost")
await client.connect()
const amount = await client.getControllerCount()
console.log(amount)
let deviceList = []
for (let deviceId = 0; deviceId < amount; deviceId++) {
deviceList.push(await client.getControllerData(deviceId))
}
console.log(deviceList)
loop()
}
async function loop(i=0){
await client.updateLeds(0, flags[flags.animate[i]])
await client.updateLeds(1, flags[flags.animate[i]])
await client.updateLeds(2, flags[flags.animate[i]])
await client.updateLeds(3, flags[flags.animate[i]])
//await client.disconnect()
i++;
if(i>=flags.animate.length){
i=0
}
setTimeout(_ => loop(i), ms)
}
console.log(flags[flags.animate[1]])
start()

View File

@ -0,0 +1,14 @@
{
"name": "openrgb_control",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"openrgb-sdk": "^0.5.2"
}
}