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

HTTP Server Daemon brightness increase/decrease by increments #92

Open
zoltak opened this issue Aug 26, 2024 · 5 comments
Open

HTTP Server Daemon brightness increase/decrease by increments #92

zoltak opened this issue Aug 26, 2024 · 5 comments

Comments

@zoltak
Copy link

zoltak commented Aug 26, 2024

Would it be possible to add support to increase/decrease brightness by increments from current setting e.g.

Increase brightness by 10 increment from current value:
http://127.0.0.1:8080/NeewerLite-Python/doAction?light=11:22:33:44:55:66&bri=+10

Decrease brightness by 5 increment from current value:
http://127.0.0.1:8080/NeewerLite-Python/doAction?light=11:22:33:44:55:66&bri=-5

The requirement is for using Stream Deck and having a button to tap to increase or decrease the brightness by increments while streaming without having to keep state on the client side.

@taburineagle
Copy link
Owner

Got you - that should be doable @zoltak, I'll add it to the list of things for the next version!

@zoltak
Copy link
Author

zoltak commented Aug 29, 2024

@taburineagle I have generated code that provides this functionality. I haven't tested with the GUI and may need more testing around the validation. You can find the update here

@taburineagle
Copy link
Owner

Ah, excellent, thank you @zoltak! I'll have to check that out over the weekend and make the changes on my end as well.

@taburineagle
Copy link
Owner

taburineagle commented Aug 30, 2024

OK, I've taken a quick look at the code changes @zoltak, and everything looks good, still need to do a few things first before making a PR, but looks good - I also saw you improved the logistics for that one section in processHTMLCommands, that makes more sense to get the list of lights first... One thing I'm a little bit confused by though, is why did you convert the brightness value to a float? Neewer lights only use integer math (there's no 55.5% brightness, only 55% and 56%), so I'm assuming it needs to be a float to work more nicely with max/min?

Ah, I think I see why - if you try to coerce a string with a decimal into an int, it throws an error... interesting.

@zoltak
Copy link
Author

zoltak commented Aug 30, 2024

@taburineagle I think it should be ok cast as a int. I did a quick test and it didn't throw any errors.

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

No branches or pull requests

3 participants
@zoltak @taburineagle and others