1.1.3 • Published 3 years ago

esprgb_libjs v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

ESPRGB_LibJS

This is a library made to simplify the development of ESPRGB clients in javascript by handling everything in the back so you'll only need to bind buttons and change variables with the provided events.

It creates the websocket connection required, it parses all the messages, emits events when a variable changes and it includes all the function you need to change the animations and parameters.

Install with NPM

npm install esprgb_libjs --save

Include

<script src="./ESPRGB_LibJS.js" ></script>
or
const ESPRGB = require("esprgb_libjs")

Usage

<button onclick="myDevice.ConnectToggle()">Connect</button>
<button onclick="myDevice.restart()">restart</button>
<button onclick="myDevice.format()">format</button>
<button onclick="myDevice.removeUserData()">remove user data</button>

var myDevice = new ESPRGB('esprgb-test.local');
// events
myDevice.SolidColor.on('Color:change', (e)=>{
    document.getElementById("SolidColorR").value = e.Color[0];
    document.getElementById("SolidColorG").value = e.Color[1];
    document.getElementById("SolidColorB").value = e.Color[2];
});
myDevice.SolidColor.on('Brightness:change', (e)=> document.getElementById('SolidColor_Brightness').value = e.Brightness*100 );

For more code check the demo.html

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago