-
Notifications
You must be signed in to change notification settings - Fork 142
adaptive lighting support for CCT lights #1028
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
Changes from 3 commits
7c14ba1
d796608
b9dafce
42ec243
cdc3679
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,14 @@ void CreateComponents(std::vector<std::unique_ptr<Component>> *comps, | |
| return; | ||
| } | ||
|
|
||
| // Use adaptive lightning when possible (CCT) | ||
| std::unique_ptr<hap::AdaptiveLighting> adaptive_light; | ||
| adaptive_light.reset(new hap::AdaptiveLighting(hap_light.get(), lb_cfg)); | ||
| auto st = adaptive_light->Init(); | ||
| if (st.ok()) { | ||
| hap_light->SetAdaptiveLight(std::move(adaptive_light)); | ||
| } | ||
|
|
||
|
Comment on lines
+52
to
+59
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this be integrated in the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it could. But on the other hand: the controller should not need to know about adaptive lights existing. And the Adaptive Lightning Protocol of Apple is generic in the way that it could support autotuning other characteristics, not limited to only color temperature, so I actually think it would make more sense this way
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good argument. My main point is that I don't like ot have redundant code in the device specific files. You follow the current pattern, so it's ok. That problem should be solved, but not in this PR.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree |
||
| mgos::hap::Accessory *pri_acc = accs->front().get(); | ||
| shelly::hap::LightBulb *light_ref = hap_light.get(); | ||
| hap_light->set_primary(true); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.