iobroker-community-adapters / ioBroker.hue

Control Philips Hue Bridge
http://www.iobroker.org
Apache License 2.0
43 stars 28 forks source link

Increments or decrements of brightness does not work correctly #543

Open beetlejules opened 10 months ago

beetlejules commented 10 months ago

Describe the bug The "bri_inc" command does not work correctly.

I have tested with the debugger. Permitted values here are -254 to 254.

Let's assume that we are currently at a brightness of 100. If I send a "bri_inc": 254, I get a response "success": {"/lights/7/state/bri": 254}. This means it is limited.

However, if I send with the HUE adapter, it turns it into 99, so it is incremented in the cycle. Both when incrementing and decrementing.

The second problem is the decrements. Let's assume again that we are currently at a brightness of 100. If I send a "bri_inc": -254, I get a response "success": {"/lights/7/state/bri": 0}. In other words, there is also a limit here. However, the lights are only dimmed to 1, the first response with bri: 0 is followed by a response with bri: 1

The first response may also result in the HUE Adapter error "Error: Value, '0' is not within allowed limits: min=1 max=254 for 'bri' at UInt8Type"

Expected behavior

Screenshots & Logfiles

Error: Value, '0' is not within allowed limits: min=1 max=254 for 'bri' at UInt8Type.getValue (/opt/iobroker/node_modules/node-hue-api/lib/types/RangedNumberType.js:40:13) at LightState._setStateValue (/opt/iobroker/node_modules/node-hue-api/lib/model/lightstate/States.js:87:53) at LightState.bri (/opt/iobroker/node_modules/node-hue-api/lib/model/lightstate/BaseStates.js:34:17) at Hue.onStateChange (/opt/iobroker/node_modules/iobroker.hue/build/main.js:644:37)

First response after negative value: grafik

Versions: