Skip to content

Min brightness support #61

Answered by 0x5e
JasperSnowolf asked this question in Q&A
Nov 9, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Thanks @JasperSnowolf , yes I'm not process properly currently.

We can get brightness property via this.getBrightnessSchema().property, as it's a integer type, property has min, max, scale, step, which describes your device's brightness value.

Some light maybe min=10, max=1000, some maybe min=1, max=100. As we can infer, whatever the unit it is, 0 always means no brightness at all. But why some min != 0? I think it's because the limitation of the light's accuracy, they are not able to set a very very small brightness.

So we should remap 0%~100% to 0~max instead of 0%~100% to min~max.

And we can use service.setProps() to change the light accessory's minValue. Then we can't slide the bright…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@0x5e
Comment options

0x5e Nov 9, 2022
Maintainer

@0x5e
Comment options

0x5e Nov 9, 2022
Maintainer

@JasperSnowolf
Comment options

Answer selected by JasperSnowolf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants