Min brightness support #61
-
Hey there! I have some Geeni bulbs I'm trying to control. I am able to do everything except turn them off (turning on works, and setting brightness). When I go to turn them off, I get an "Invalid Parameter" message. This seems to be because the min brightness value for these bulbs is 9, so any attempt to set a lower value fails. It looks like this also causes the Characteristic.On update to fail to since they are sent in the same request. I was able to fix this in my case by editing the LightAccessory.ts file and adding a check on the brightness value before it is updated. So if the value was going to be set to a value less than 9, it skipped the update. If this capability already exists through some configuration, let me know! If not, it would be useful to be able to configure a min/max brightness setting for each device. Update:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Thanks @JasperSnowolf , yes I'm not process properly currently. We can get brightness property via Some light maybe So we should remap And we can use Would you like to help me fixing it? Thanks a lot :) |
Beta Was this translation helpful? Give feedback.
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 hasmin
,max
,scale
,step
, which describes your device's brightness value.Some light maybe
min=10, max=1000
, some maybemin=1, max=100
. As we can infer, whatever the unit it is,0
always means no brightness at all. But why somemin != 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%
to0~max
instead of0%~100%
tomin~max
.And we can use
service.setProps()
to change the light accessory'sminValue
. Then we can't slide the bright…