Skip to content

Commit

Permalink
v6.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
seydx committed Jun 27, 2021
1 parent fdb414e commit 87ad14e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

# v6.0.9 - 2021-06-28

## Other Changes
- Fixed an issue where changing lightbulb color didnt work

# v6.0.8 - 2021-06-27

## Other Changes
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-fritz-platform",
"version": "6.0.8",
"version": "6.0.9",
"description": "Homebridge Plugin to control FritzBox router, smarthome devices and more.",
"main": "index.js",
"funding": [
Expand Down
20 changes: 16 additions & 4 deletions src/accessories/smarthome/smarthome.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1217,9 +1217,15 @@ class Handler {
}
} else {
//color
let validHueSat = getValidColor(accessory, false, state);
//state = saturation
const hue = accessory
.getService(this.api.hap.Service.Lightbulb)
.getCharacteristic(this.api.hap.Characteristic.Hue).value;

const validHueSat = getValidColor(hue, state);

logger.info(
`Hue ${validHueSat.hue} - Saturation ${validHueSat.sat}`,
`Hue ${hue} (${validHueSat.hue}) - Saturation ${state} (${validHueSat.sat})`,
`${accessory.displayName} (${subtype})`
);

Expand Down Expand Up @@ -1337,9 +1343,15 @@ class Handler {
}
} else {
//color
let validHueSat = getValidColor(accessory, false, state);
//state = saturation
const hue = accessory
.getService(this.api.hap.Service.Lightbulb)
.getCharacteristic(this.api.hap.Characteristic.Hue).value;

const validHueSat = getValidColor(hue, state);

logger.info(
`Hue ${validHueSat.hue} - Saturation ${validHueSat.sat}`,
`Hue ${hue} (${validHueSat.hue}) - Saturation ${state} (${validHueSat.sat})`,
`${accessory.displayName} (${subtype})`
);

Expand Down
1 change: 1 addition & 0 deletions src/accessories/smarthome/smarthome.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ exports.colortemp2api = (param) => {
};

exports.getValidColor = (hue, sat) => {
hue = Math.round(hue);
sat = Math.round(sat);

let hues = [35, 52, 92, 120, 160, 195, 212, 225, 266, 296, 335, 358];
Expand Down

0 comments on commit 87ad14e

Please sign in to comment.