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 Philips Hue action type #33

Merged
merged 1 commit into from May 24, 2017

Conversation

Projects
None yet
5 participants
@bazwilliams
Contributor

bazwilliams commented May 12, 2017

This adds Philips hue support using the phue library.

It would be nice to configure the hue bridge in the global configuration file, but I wasn't able to find a nice way to pass this into the actions.py class. As such I've forced the user to set it for each actor request.

Example use where the hostname for my Hue bridge is philips-hue.

actor.add_keyword(_('change to purple'), ChangeLightColour(say, "philips-hue", "Lounge Lamp", "FFFFbe"))

@googlebot

This comment has been minimized.

Show comment
Hide comment
@googlebot

googlebot May 12, 2017

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

googlebot commented May 12, 2017

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@googlebot googlebot added the cla: no label May 12, 2017

@bazwilliams

This comment has been minimized.

Show comment
Hide comment
@bazwilliams

bazwilliams May 12, 2017

Contributor

I signed it!

Contributor

bazwilliams commented May 12, 2017

I signed it!

@googlebot

This comment has been minimized.

Show comment
Hide comment
@googlebot

googlebot May 12, 2017

CLAs look good, thanks!

googlebot commented May 12, 2017

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels May 12, 2017

Show outdated Hide outdated src/action.py
@ensonic

This comment has been minimized.

Show comment
Hide comment
@ensonic

ensonic May 15, 2017

Collaborator

Thanks. Please squash the changes and make sure travis is happy (follow Details link).

Collaborator

ensonic commented May 15, 2017

Thanks. Please squash the changes and make sure travis is happy (follow Details link).

@bazwilliams

This comment has been minimized.

Show comment
Hide comment
@bazwilliams

bazwilliams May 15, 2017

Contributor

Squashed and fixed travis. Also use if bridge: as suggested.

Contributor

bazwilliams commented May 15, 2017

Squashed and fixed travis. Also use if bridge: as suggested.

@drigz

This comment has been minimized.

Show comment
Hide comment
@drigz

drigz May 18, 2017

Member

Thanks for the PR, @bazwilliams! If you can use rgbxy from PyPI, it's just some style changes required.

Member

drigz commented May 18, 2017

Thanks for the PR, @bazwilliams! If you can use rgbxy from PyPI, it's just some style changes required.

@bazwilliams

This comment has been minimized.

Show comment
Hide comment
@bazwilliams

bazwilliams May 18, 2017

Contributor

@drigz What style changes do I need to make?

I tried the rgbxy lib from PyPI as I'd rather install the dependency, but it failed to install. I'll have another look tonight to see what I can do.

Contributor

bazwilliams commented May 18, 2017

@drigz What style changes do I need to make?

I tried the rgbxy lib from PyPI as I'd rather install the dependency, but it failed to install. I'll have another look tonight to see what I can do.

@drigz

This comment has been minimized.

Show comment
Hide comment
@drigz

drigz May 18, 2017

Member

You should see the comments on the GitHub pull request.

Also, now #48 is merged, you can add phue and rgbxy to requirements.txt. If rgbxy is broken, maybe you could get in touch with the author? If they're not responding, you'll have to fork their project. Unfortunately, we can't bring the code into our repo.

Member

drigz commented May 18, 2017

You should see the comments on the GitHub pull request.

Also, now #48 is merged, you can add phue and rgbxy to requirements.txt. If rgbxy is broken, maybe you could get in touch with the author? If they're not responding, you'll have to fork their project. Unfortunately, we can't bring the code into our repo.

@bazwilliams

This comment has been minimized.

Show comment
Hide comment
@bazwilliams

bazwilliams May 18, 2017

Contributor

Thanks for clarifying and will get the requirements.txt file updated, worst case I'll fork publish a new pypi lib for rgbxy.

Contributor

bazwilliams commented May 18, 2017

Thanks for clarifying and will get the requirements.txt file updated, worst case I'll fork publish a new pypi lib for rgbxy.

Show outdated Hide outdated src/rgb_xy.py
Show outdated Hide outdated src/action.py
Show outdated Hide outdated src/action.py
Show outdated Hide outdated src/action.py
Show outdated Hide outdated src/action.py
@drigz

This comment has been minimized.

Show comment
Hide comment
@drigz

drigz May 18, 2017

Member

FYI, I missed clicking Submit on the review, but I have now.

Member

drigz commented May 18, 2017

FYI, I missed clicking Submit on the review, but I have now.

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io May 21, 2017

Codecov Report

Merging #33 into master will decrease coverage by 69.53%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #33       +/-   ##
==========================================
- Coverage    79.2%   9.67%   -69.54%     
==========================================
  Files           5       3        -2     
  Lines         202    1705     +1503     
  Branches        0     293      +293     
==========================================
+ Hits          160     165        +5     
- Misses         42    1530     +1488     
- Partials        0      10       +10
Impacted Files Coverage Δ
src/action.py 65.21% <100%> (+8.07%) ⬆️
tests/test_actor_base.py
tests/test_speak_time.py
tests/test_speak_shell_command_output.py
src/triggers/__init__.py 4.21% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28a0228...70b8735. Read the comment docs.

codecov-io commented May 21, 2017

Codecov Report

Merging #33 into master will decrease coverage by 69.53%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #33       +/-   ##
==========================================
- Coverage    79.2%   9.67%   -69.54%     
==========================================
  Files           5       3        -2     
  Lines         202    1705     +1503     
  Branches        0     293      +293     
==========================================
+ Hits          160     165        +5     
- Misses         42    1530     +1488     
- Partials        0      10       +10
Impacted Files Coverage Δ
src/action.py 65.21% <100%> (+8.07%) ⬆️
tests/test_actor_base.py
tests/test_speak_time.py
tests/test_speak_shell_command_output.py
src/triggers/__init__.py 4.21% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28a0228...70b8735. Read the comment docs.

@bazwilliams

This comment has been minimized.

Show comment
Hide comment
@bazwilliams

bazwilliams May 22, 2017

Contributor

I added a test to improve the coverage, but it hasn't been recognised by codecov. Any idea why not?

Contributor

bazwilliams commented May 22, 2017

I added a test to improve the coverage, but it hasn't been recognised by codecov. Any idea why not?

Show outdated Hide outdated .coveragerc
@bazwilliams

This comment has been minimized.

Show comment
Hide comment
@bazwilliams

bazwilliams May 23, 2017

Contributor

@ensonic you were right! The coverage never ran due to that pep8 warning that was added by mistake. Fixing that and including the suggested .coverage file shows the coverage I was expecting!

Thanks for helping out! I've rebased the PR.

Contributor

bazwilliams commented May 23, 2017

@ensonic you were right! The coverage never ran due to that pep8 warning that was added by mistake. Fixing that and including the suggested .coverage file shows the coverage I was expecting!

Thanks for helping out! I've rebased the PR.

@ensonic ensonic merged commit 9571936 into google:master May 24, 2017

4 checks passed

cla/google All necessary CLAs are signed
codecov/patch 100% of diff hit (target 79.2%)
Details
codecov/project Absolute coverage decreased by -69.53% but relative coverage increased by +20.79% compared to 28a0228
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ensonic

This comment has been minimized.

Show comment
Hide comment
@ensonic

ensonic May 24, 2017

Collaborator

Thanks!

Collaborator

ensonic commented May 24, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment