From e38defb00d4a6281894bfe84389e55b2c60ffe88 Mon Sep 17 00:00:00 2001 From: koningcool Date: Sat, 25 Feb 2023 22:23:35 +0100 Subject: [PATCH] build v1.1.6 (WLED + Hue fix) (Also improved analytics) --- package.json | 2 +- src/main/main.js | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 187d8b7..92ff646 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "F1MV-Lights-Integration", - "version": "1.1.5", + "version": "1.1.6", "description": "The best way to connect your smart home lights to your F1MV.", "author": "JustJoostNL", "main": "src/main/main.js", diff --git a/src/main/main.js b/src/main/main.js index a4c25df..dab31c1 100644 --- a/src/main/main.js +++ b/src/main/main.js @@ -65,7 +65,7 @@ let WLEDDisabled = userConfig.get('Settings.WLEDSettings.WLEDDisable'); let WLEDDeviceIPs = userConfig.get('Settings.WLEDSettings.devices'); let analyticsPreference = userConfig.get('Settings.advancedSettings.analytics') -const APIURL = "https://api.joost.systems/api/v2" +const APIURL = "https://preprod-api.joost.systems/api/v2" let analyticsSent = false; let updateChannel = userConfig.get('Settings.advancedSettings.updateChannel') @@ -1506,10 +1506,9 @@ async function hueControl(r, g, b, brightness, action) { case "on": let hueValue = 0; let saturationValue = 0; - if (hueSelectedEntertainmentZonesIDs.length > 0) { - hueValue = Math.round(colorConverter.rgb.hsv(r, g, b)[0] * (65535 / 360)); - saturationValue = Math.round(colorConverter.rgb.hsv(r, g, b)[1] * (254 / 100)); - } + hueValue = Math.round(colorConverter.rgb.hsv(r, g, b)[0] * (65535 / 360)); + saturationValue = Math.round(colorConverter.rgb.hsv(r, g, b)[1] * (254 / 100)); + if (hue3rdPartyCompatMode) { for (const light of hueSelectedDeviceIDs) { lightsOnCounter++; @@ -2038,8 +2037,16 @@ async function WLEDControl(r, g, b, brightness, action){ await WLEDDevice.updateState({ on: true, brightness: brightness, + mainSegmentId: 0, + segments: [ + { + effectId: 0, + colors: [[r,g,b]], + start: 0, + stop: WLEDDevice.info.leds.count + } + ] }) - await WLEDDevice.setColor([r, g, b]) break; case "off": @@ -2140,6 +2147,7 @@ async function sendAnalytics() { //remove personal data from config delete config.Settings.ikeaSettings.securityCode; + delete config.Settings.ikeaSettings.psk; delete config.Settings.hueSettings.token; for (const device of config.Settings.nanoLeafSettings.devices) { delete device.token;