Giter Site home page Giter Site logo

boblight-js's Introduction

boblight-js

Node.js CI styled with prettier

boblight-js is a client library for boblight.

Requirements

Node.js >= 12

Installation

npm install boblight-js --save

Example

const boblib = require('boblight-js')

const boblightClient = new boblib.BoblightClient()
await boblightClient.connect('localhost', 19333)

boblightClient.setColorForAll(boblib.Colors.red)
boblightClient.sleep()
boblightClient.setColorForAll(new boblib.Color(0, 0, 1))

API

BoblightClient

Connects to the server at host with port and priority:

connect(host = 'localhost', port = 19333, priority = 128)

Get all lights:

getLights()

Sets the color for all lights:

setColorForAll(color = new Color(0, 0, 0))

Sets the color of the specified light:

setColor(light, color = new Color(0, 0, 0))

Sets the transitioning speed of the specified light:

setSpeed(light, speed = 1)

Sets the priority of this boblight client:

setPriority(prioritiy = 128)

Checks if the boblight server answers:

ping()

Reconnects to the boblight server:

reconnect()

Sleep for msSeconds:

async sleep(msSeconds = 1000)

Color

Creates a color: red, green, blue must be a value between 0 and 1

new Color(red = 0, green = 0, blue = 0):

boblight-js's People

Contributors

dependabot[bot] avatar scic avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.