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

Add dimming_delta support #417

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

olsen-sorensen
Copy link

@olsen-sorensen olsen-sorensen commented Oct 4, 2024

This method sets the brightness_delta value and its action based on the
value to up/down/stop. This can be useful if someone wants to dim a light to
the max/min value within a dedicated transition time but stop the
transition when for instance a btn was released.

resolves #420

@olsen-sorensen
Copy link
Author

olsen-sorensen commented Oct 4, 2024

I think it makes sense to open the libraries api a bit more to support dimming_delta functionality. So I'll change the code in a more generic way like

set_brightness_delta(brightness_delta: float | None = None)

if brightness is None we do not send any update, however this should not happen :)

@olsen-sorensen olsen-sorensen marked this pull request as draft October 4, 2024 06:12
@olsen-sorensen olsen-sorensen changed the title Add stop_dimming method Add dimming_delta support Oct 4, 2024
@olsen-sorensen olsen-sorensen force-pushed the feature/add_stop_dimming branch from f7b4892 to aad9012 Compare October 6, 2024 08:35
@olsen-sorensen olsen-sorensen marked this pull request as ready for review October 6, 2024 08:41
@olsen-sorensen olsen-sorensen force-pushed the feature/add_stop_dimming branch 3 times, most recently from aa4d88b to 3e0ba79 Compare October 6, 2024 19:36
@marcelveldt
Copy link
Collaborator

@olsen-sorensen any follow-up on my small comment ? Then we can wrap it up

@olsen-sorensen
Copy link
Author

olsen-sorensen commented Dec 20, 2024

@marcelveldt sure thing, as the brightness_delta parameter is a float value I have to change that anyways, I'll set a stop action if brightness value is not passed or None, that's more correct.

This method sets the brightness_delta value and its action based on the
value to up/down/stop. This can be useful if someone wants to dim a light to
the max/min value within a dedicated transition time but stop the
transition  when for instance a btn was released.
@olsen-sorensen olsen-sorensen force-pushed the feature/add_stop_dimming branch from 3e0ba79 to b25a585 Compare December 20, 2024 21:26
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.

Feature dimming_delta not supported
2 participants