Skip to content

Commit 9790711

Browse files
author
QuickSander
committed
feat: Small updates
1 parent f662985 commit 9790711

File tree

6 files changed

+846
-29
lines changed

6 files changed

+846
-29
lines changed

.eslintrc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
env:
2+
browser: true
3+
commonjs: true
4+
es2021: true
5+
extends: 'eslint:recommended'
6+
parserOptions:
7+
ecmaVersion: 12
8+
rules: {}

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build, Lint and Release
1+
name: Build, Lint, Test and Release
22

33
on: [push, pull_request]
44

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ HttpPushRgb.prototype = {
188188

189189
this.getPowerState( (error, onState) => {
190190

191+
// eslint-disable-next-line no-unused-vars
191192
this.setPowerState(!onState, (error, responseBody) => {
192193
// Ignore any possible error, just continue as if nothing happened.
193194
setTimeout(() => {
@@ -277,8 +278,6 @@ HttpPushRgb.prototype = {
277278
* @param {function} jsonRequest The characteristic and characteristic value to update.
278279
*/
279280
handleNotification: function (jsonRequest) {
280-
const service = jsonRequest.service;
281-
282281
const characteristic = jsonRequest.characteristic;
283282
const value = jsonRequest.value;
284283

@@ -373,10 +372,11 @@ HttpPushRgb.prototype = {
373372
if (this.brightness) {
374373
this._httpRequest(this.brightness.status.url, '', 'GET', function(error, response, responseBody) {
375374
if (!this._handleHttpErrorResponse('getBrightness()', error, response, responseBody, callback)) {
375+
var level;
376376
if (typeof this.brightness.status.bodyRegEx === 'object') {
377-
var level = responseBody.match(this.brightness.status.bodyRegEx)[1];
377+
level = parseInt(responseBody.match(this.brightness.status.bodyRegEx)[1]);
378378
} else {
379-
var level = parseInt(responseBody);
379+
level = parseInt(responseBody);
380380
}
381381

382382
level = parseInt(100 / this.brightness.max * level);

0 commit comments

Comments
 (0)