Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increments or decrements of brightness does not work correctly #543

Open
beetlejules opened this issue Dec 14, 2023 · 0 comments
Open

Increments or decrements of brightness does not work correctly #543

beetlejules opened this issue Dec 14, 2023 · 0 comments
Labels

Comments

@beetlejules
Copy link

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

  • If I stay within the brightness of 1-254 with the increments, everything is ok. If I get outside these values, limit it instead of putting it into circulation.
  • No error with response brightness 0 in this case.

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:

  • Adapter version: 3.10.1
@mcm1957 mcm1957 added the bug label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants