From 1c45bfcb4c15e7bdf8c56b7ac8dc8ce7740c0b81 Mon Sep 17 00:00:00 2001 From: David Miller Date: Tue, 1 Feb 2022 20:58:56 +0000 Subject: [PATCH] Fix RGB light validation failures [RGB] Ignoring invalid value [29.01960784313726] for Brightness - not an integer --- docs/ReleaseNotes.md | 3 ++ index.js | 6 ++-- package.json | 2 +- ...e-backup-DB7DA324AA69.1642526521547.tar.gz | Bin 0 -> 9770 bytes test/config.json | 27 ++++++++++++++++++ 5 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 test/backups/instance-backups/homebridge-backup-DB7DA324AA69.1642526521547.tar.gz diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 30d03c1..64b0184 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -5,6 +5,9 @@ # Homebridge MQTT-Thing: Release Notes +### Version 1.1.39 ++ Fix RGB light validation errors (issue #510) + ### Version 1.1.38 + Fix to use valid initial value for airPressure (0 invalid) diff --git a/index.js b/index.js index 621e007..c5919f5 100644 --- a/index.js +++ b/index.js @@ -975,9 +975,9 @@ function makeThing( log, accessoryConfig, api ) { blue = Math.min( blue + white, 255 ); var hsv = RGBtoScaledHSV( red, green, blue ); - var hue = hsv.h; - var sat = hsv.s; - var bri = hsv.v; + var hue = Math.floor( hsv.h ); + var sat = Math.floor( hsv.s ); + var bri = Math.floor( hsv.v ); if( !config.topics.setOn ) { var on = bri > 0 ? 1 : 0; diff --git a/package.json b/package.json index ca06f5a..1844fc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-mqttthing", - "version": "1.1.38", + "version": "1.1.39", "description": "Homebridge plugin supporting various services over MQTT", "main": "index.js", "scripts": { diff --git a/test/backups/instance-backups/homebridge-backup-DB7DA324AA69.1642526521547.tar.gz b/test/backups/instance-backups/homebridge-backup-DB7DA324AA69.1642526521547.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f71968680b9b94571f4c0560111e74016ad0e359 G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