Closed nagyrobi closed 3 years ago
The min
and the max
levels could be simply set in brightness = ranged_value_to_percentage((0, 255), self._brightness)
instead of 0 and 255.
Thus the slider would work only between min and max not 0 and 255.
I'm ok with changing the dim values from 0-100 to 0-255 too. This is more in line with other gpio led levels.
the awake brightness was a concept from the initial version...
currently its a "previous brightness" meaning the value to which brightness will be restored when the plate awaken.
I don't think setting the awake brightness provides a good UX, depending on the time of the day I would like to have a different level...
to avoid turning off (dim 0) I think I will limit the brightness to 1 (it is done in other light integrations)
Maybe the firmware needs to interpret dim=0 as light=off to avoid confusion? That way, dim can never go completely to 0.
No I think we should leave firware handle 0 as zero, as most lamps do it like this.
I'm confused... how do we proceed @fvanroie ?
Make the firmware 0-255 and limit CC to 1-255 dim level. I think that covers all possibilities.
OK! When you push that change, please reference this issue, so I can implement the change :)
I think we can close this now https://github.com/HASwitchPlate/openHASP-custom-component/commit/2d9fb24333f31b26946d0b4f55b6374763fcf76a
Backlight level currently only has one slider, which acts on the awake level. A bit confusing though that the slider position goes down to the value of idle brightness, when the plate is idle - the slider is showing the actual brightness value, whilst it's setting the awake brightness level.
As we had earlier in the component config, we could offer a way to configure default levels:
To impose some practical constraints for accidental or unwanted settings (one may drag the slider to 0 and then misunderstand why the screen turned off completely; max limit would help the owner to save for long-term burn-in or power consumption).
This would require two separate sliders, either by implementing two virtual lights, or alternatively by re-using some other property of light component like
white_value
(maybe not a good idea as it may conflict with other stuff in HA).