Skip to content

Commit

Permalink
build v1.1.6 (WLED + Hue fix) (Also improved analytics)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustJoostNL committed Feb 25, 2023
1 parent 4ffc372 commit e38defb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
20 changes: 14 additions & 6 deletions src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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++;
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e38defb

Please sign in to comment.