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

Merged

Conversation

olsen-sorensen
Copy link
Contributor

@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
Contributor 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
Contributor 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 5b75b22 to 9e85bb9 Compare January 29, 2025 15:56
@marcelveldt marcelveldt added the new-feature New feature or request label Jan 30, 2025
Copy link
Collaborator

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @olsen-sorensen !

@marcelveldt marcelveldt merged commit 2be1d24 into home-assistant-libs:main Jan 30, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature dimming_delta not supported
2 participants