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 more philips effect lights #5312

Merged
merged 8 commits into from
Jan 16, 2023

Conversation

deviantintegral
Copy link
Contributor

This PR adds candle effect support for additional lights.

I have confirmed this works on:

  • LTA008
  • LWA003
  • LWS002 - while this shows up in the Hue app, and the bulb changes brightness, to my eyes it doesn't really animate in the same way as other lights. Since the Hue app shows it, I think we should too.

I don't have LWW002 to test with. Since it's the same definition and title as LWA003 I assume it works and it's just a later revision?

As well, for testing this with an external converter required a ton of copy-paste. Would we consider exporting hueExtend?

Finally, I'm not sure if Philips makes lights that are a "bright white" color temperature only. If so, I assume they don't support Candle in which case I think we'd want to change what's light_onoff_brightness to something like light_onoff_warm_brightness.

@Koenkk
Copy link
Owner

Koenkk commented Jan 12, 2023

I don't have LWW002 to test with. Since it's the same definition and title as LWA003 I assume it works and it's just a later revision?

That's fine!

As well, for testing this with an external converter required a ton of copy-paste. Would we consider exporting hueExtend?

Yes please do so in a new lib/philips.js file just like xiaomi.js and tuya.js.

Thanks for your contributions again!

lib/philips.js Outdated
@@ -249,4 +659,9 @@ function encodeGradientColors(value, opts) {
module.exports = {
decodeGradientColors,
encodeGradientColors,
hueExtend,
Copy link
Owner

Choose a reason for hiding this comment

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

Since this is in philips.js, we can rename this to just extend. (we do the same for TuYa)

const e = exposes.presets;
const ea = exposes.access;

// Make sure extend.light_* is not used (hueExtend should be used instead)
// Make sure extend.light_* is not used (philips.hueExtend should be used instead)
const extendDontUse = require('../lib/extend');
const extend = {switch: extendDontUse.switch};
Copy link
Owner

@Koenkk Koenkk Jan 13, 2023

Choose a reason for hiding this comment

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

const extendDontUse = require('../lib/extend'); can be removed, when changing const extend = {switch: extendDontUse.switch}; to const extend = {switch: require('../lib/extend').switch};

lib/philips.js Outdated
@@ -249,4 +659,9 @@ function encodeGradientColors(value, opts) {
module.exports = {
decodeGradientColors,
encodeGradientColors,
hueExtend,
tzLocal,
fzLocal,
Copy link
Owner

Choose a reason for hiding this comment

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

Local can be dropped (just like TuYa):

@deviantintegral
Copy link
Contributor Author

Thanks for the review. All done!

@Koenkk Koenkk merged commit 6a0b046 into Koenkk:master Jan 16, 2023
@Koenkk
Copy link
Owner

Koenkk commented Jan 16, 2023

Looks great, thanks!

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.

2 participants