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 an option to update hue scenes based on a keywork #1019

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

BenoitAnastay
Copy link

This PR will let you set a keyword to search in your scenes list and update the set brightness and colortemp without changing power state.

It is usefull when you use Hue Bridge and you set your buttons to a scene.
It is not working with multiple bridge instance, it will only update the first bridge, this behaviour is easy to fix but I don't have a second bridge make tests

Usage exemple:

  1. Create scenes with names like AL_living room celling light, AL_living room table top light, AL_living room all lights with the lights you want to be turned on.
  2. Add AL_living room as keyword and all living room scenes will be update

Solves #271

@BenoitAnastay
Copy link
Author

@th3w1zard1 Hi, please have a look to this PR, you were interested into this implementation

@th3w1zard1
Copy link
Collaborator

Well that was quite a rabbit hole of information I had forgotten about.

I am not familiar with the async code you're using. Usually we use hassio's api as migrating to other async implementations have caused bugs in the past. I know next to nothing about that.

other than that your implementation looks good. You are creating yet another attr, ensuring existing functionality will persist, showing a clear understanding of our process.

@BenoitAnastay
Copy link
Author

@th3w1zard1 Thanks for the feedback, I'll now try to cleanup my PR, making tests pass.

I don't know how I can properly document this functionality to make it clear for everyone.
I might also replace the keyword by a droplist of scenes light for lights entities, the configuration might take longer but it will help casual user to avoid error such as two overlaping keyword

For the main logic I know its robust, I use it since 2022 with another custom_integration (claytonjn/hass-circadian_lighting#195)

@BenoitAnastay
Copy link
Author

Hum there is a bug values aren't updated with daylight, it's probably out of range values of hue bridge, I'll check that

@BenoitAnastay BenoitAnastay marked this pull request as draft July 11, 2024 23:33
@BenoitAnastay BenoitAnastay marked this pull request as ready for review September 16, 2024 15:15
@BenoitAnastay
Copy link
Author

I've added a delays of 5 minutes between same keyword update to avoid overloading the bridge.
Maybe i'll need to add a delay between each API call as well

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.

3 participants