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

New cutoff values for min_brightness and max_brightness #72

Closed
haseat opened this issue Jan 4, 2021 · 7 comments · May be fixed by #567
Closed

New cutoff values for min_brightness and max_brightness #72

haseat opened this issue Jan 4, 2021 · 7 comments · May be fixed by #567

Comments

@haseat
Copy link

haseat commented Jan 4, 2021

Hi,

right now the parameters min_brightness and max_brightness serve - when set - as new limits for the calculation of the actual brightness, e.g. when min_brightness is 80 and max_brightness is 100 and calculated brightness is 50, the actual brightness will be 90 (50% between 80 and 100). Is it possible to add new parameters which do not influence the calculation, but limit the return value?

pseudo-code:

if calculatedBrightness < minBrightness return(minBrightness)
if calculatedBrightness > maxBrightness return(maxBrightness)
return(calculatedBrightness)
min 0 80 80
max 100 100 100
% calculated calculated now should be
0 0 80 80
5 5 81 80
10 10 82 80
20 20 84 80
30 30 86 80
40 40 88 80
50 50 90 80
60 60 92 80
70 70 94 80
80 80 96 80
90 90 98 90
100 100 100 100

Thanks for this great addon!
Robert

@hebgit
Copy link

hebgit commented Apr 30, 2021

This is exactly what I need.

@euinor
Copy link

euinor commented May 4, 2021

I would vote for this - I would like to have the min/max settings behave as ceilings or floors for the brightness/colour graphs. Currently how they behave maintains the shape of the graph and just changes the Y Axis.

Someone on the forum suggested the settings 'absolute_(min/max)_(brightness/colour_temp)'

@RubenKelevra
Copy link
Collaborator

@haseat / @whig0 / @euinor

Hey guys, I understand what you want - but I don't really get why. So the transition isn't fast enough in the morning/evening?

That would be #62

Or is there something else that is the issue with the color temperature curve right now?

@euinor
Copy link

euinor commented Jan 9, 2022

If I recall I wanted this to flatten the curve for colours, in order to fix the night or day colour to static, while keeping the dawn/dusk transition. If you have long nights or days it is good to have the night or day colour reached and then stay there. Currently it transitions slowly to the min/max value slowly throughout the evening or day.

So #62 might cover my wants, depending on what the conclusion was.

@th3w1zard1
Copy link
Collaborator

th3w1zard1 commented Apr 10, 2023

if calculatedBrightness < minBrightness return(minBrightness)
if calculatedBrightness > maxBrightness return(maxBrightness)
return(calculatedBrightness)

I didn't even see your pseudo code when I wrote this code to add this in:

if self.flat_limits:
    if percent * 100 > self.max_brightness:
        return self.max_brightness
    elif percent * 100 < self.min_brightness:
        return self.min_brightness
    return percent * 100

@basnijholt
Copy link
Owner

Check out the new brightness_mode feature introduced in 1.19.0: https://github.com/basnijholt/adaptive-lighting/blob/104664d3588442730f7ea9e811dd1986aca0c2e8/README.md#custom-brightness-ramps-using-brightness_mode-with-linear-and-tanh via #699

This should give you enough control to change brightness precisely.

Some more examples:
Notice the values of brightness_mode_time_light and brightness_mode_time_dark in the text box.
image
image
image
image

@basnijholt
Copy link
Owner

Check out this new webapp to visualize the parameters https://basnijholt.github.io/adaptive-lighting/

adaptive-lighting

adaptive-lighting.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment