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

feat(notification): add philips hue #681

Merged
merged 24 commits into from Nov 5, 2020
Merged

Conversation

MattieX
Copy link
Contributor

@MattieX MattieX commented Nov 4, 2020

Description

Added Philips Hue notification support over LAN or Cloud using Node-Hue-Api (See https://www.npmjs.com/package/node-hue-api).

Can set the color of the lights, whether they should blink, and individual light IDs to adjust.

Environment Variables
Environment variable Description Notes
PHLIPS_HUE_API_KEY Hue Bridge API Key Required, generate key using instructions here. This will be used for both LAN and cloud access over the official Remote Hue API.
PHLIPS_HUE_LAN_BRIDGE_IP LAN IP Address of your Hue Bridge LAN only, e.g. 192.168.x.x
PHLIPS_HUE_LIGHT_IDS Light IDs Optional (all if not supplied). Comma seperated, e.g.: 1, 2
PHLIPS_HUE_LIGHT_COLOR Color in RGB Format Optional (NVIDIA green if not supplied). Comma separated, e.g.: 255, 255, 255
PHLIPS_HUE_LIGHT_PATTERN blink or empty Optional - lights will flash for 30 seconds if blink is supplied.
PHLIPS_HUE_CLOUD_ACCESS_TOKEN Remote Access Token Cloud only, the access token obtained from Philips's Remote Hue API. Instructions to generate here.
PHLIPS_HUE_CLOUD_REFRESH_TOKEN Remote Refresh Token Cloud only, the refresh token obtained from Philips's Remote Hue API.
PHLIPS_HUE_CLOUD_CLIENT_ID Remote Client ID Cloud only, the client ID to use when accessing the Remote Hue API.
PHLIPS_HUE_CLOUD_CLIENT_SECRET Remote Client Secret Cloud only, the client secret to use when accessing the Remote Hue API.

Testing

Used npm run test:notification after filling in required environment variables, observed the resulting change in Hue lights.

New dependencies

node-hue-api

@MattieX MattieX requested a review from jef as a code owner November 4, 2020 00:58
@MattieX MattieX marked this pull request as draft November 4, 2020 01:37
@banksio banksio force-pushed the philips-hue-notifications branch 2 times, most recently from d1c5150 to e49c479 Compare November 4, 2020 13:31
@MattieX MattieX marked this pull request as ready for review November 4, 2020 13:32
@MattieX MattieX marked this pull request as draft November 4, 2020 13:34
@jef
Copy link
Owner

jef commented Nov 4, 2020

LOL... This is pretty awesome. I'd love to see this come in. If you have any demo to video that would be actually amazing.

@MattieX MattieX changed the title feat(philips_hue): Add Philips Hue notification support over either LAN or Cloud feat(philips-hue): Add Philips Hue notification support over either LAN or Cloud Nov 4, 2020
@banksio
Copy link
Contributor

banksio commented Nov 4, 2020

Checks should all be passing now, please let us know if we need to make any changes!

@MattieX MattieX marked this pull request as ready for review November 4, 2020 23:01
@MattieX
Copy link
Contributor Author

MattieX commented Nov 4, 2020

LOL... This is pretty awesome. I'd love to see this come in. If you have any demo to video that would be actually amazing.

Sure! https://www.youtube.com/watch?v=EI2fWgsLOkg you are.

@shortywz
Copy link

shortywz commented Nov 4, 2020

LOL... This is pretty awesome. I'd love to see this come in. If you have any demo to video that would be actually amazing.

Sure! https://www.youtube.com/watch?v=EI2fWgsLOkg you are.

This is what open source is all about 😄

@jef
Copy link
Owner

jef commented Nov 5, 2020

LOL... This is pretty awesome. I'd love to see this come in. If you have any demo to video that would be actually amazing.

Sure! youtube.com/watch?v=EI2fWgsLOkg you are.

Omg... I love it.

Thank YOU!

Copy link
Owner

@jef jef left a comment

Choose a reason for hiding this comment

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

Overall, looks pretty good! Just a couple things and we can get this in!

README.md Outdated Show resolved Hide resolved
.brightness(100)
.rgb(46.27, 72.55, 0);

const adjustLightsWithAPI = (hueBridge: import('node-hue-api/lib/api/Api')) => {
Copy link
Owner

Choose a reason for hiding this comment

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

I'd prefer you import the type above and use here.

@MattieX MattieX requested a review from jef November 5, 2020 23:09
Copy link
Owner

@jef jef left a comment

Choose a reason for hiding this comment

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

AWESOME! Thank you!

@jef jef changed the title feat(philips-hue): Add Philips Hue notification support over either LAN or Cloud feat(notification): add philips hue Nov 5, 2020
@jef jef merged commit c8a9b0b into jef:main Nov 5, 2020
@jef
Copy link
Owner

jef commented Nov 5, 2020

@MattieX, do you mind if I link your video in the README?

@MattieX
Copy link
Contributor Author

MattieX commented Nov 6, 2020

@MattieX, do you mind if I link your video in the README?

Sure - I've updated it to include the new project name now. Here you are: https://vimeo.com/476083242

@jef
Copy link
Owner

jef commented Nov 6, 2020

That's thoughtful of you! Thanks for doing that. I'll add now!

jef added a commit that referenced this pull request Nov 6, 2020
Refs: #681 (comment)
Signed-off-by: Jef LeCompte <jeffreylec@gmail.com>
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.

None yet

4 participants