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

Fix calculating brightness percentage of 0% causing bad request #209

Closed
wants to merge 1 commit into from

Conversation

nicodreher
Copy link
Contributor

Add lower limit for brightness to 1%.

fixes #208

@tschamm
Copy link
Owner

tschamm commented Nov 30, 2024

Which kind of light type you have testet that? I tested the current version with Hue White Ambiance lights. HA has a brightness range from 0...255, while Bosch supports brightness values from 0..100.
When setting brightness to 1%, everything is ok. When setting brightness to 1 in HA, the light turns off, as the conversion leads to an api call with brightness 0.

@nicodreher
Copy link
Contributor Author

I have tested it with the Bosch Smart Home Dimmer https://www.bosch-smarthome.com/de/de/produkte/geraete/dimmer/

Setting the Brightness to 1% works fine. But setting it to 1 in HA leads the following error: SHC Error (message: API call returned non-OK result (code 400)!: b'{"@type":"JsonRestExceptionResponseEntity","errorCode":"INVALID_REQUEST_OBJECT","statusCode":400}')

@tschamm
Copy link
Owner

tschamm commented Jan 11, 2025

Thank you, I merged your changes.

@tschamm tschamm closed this Jan 11, 2025
tschamm added a commit that referenced this pull request Jan 11, 2025
* nicodreher-master:
  Fix calculating brightness percentage of 0% causing bad request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to set brightness value of smart dimmer to 1
2 participants