amimof / huego

An extensive Philips Hue client library for Go with an emphasis on simplicity
MIT License
250 stars 36 forks source link

Make the API context.Context aware #19

Closed dlsniper closed 4 years ago

dlsniper commented 4 years ago

This closes #8 while keeping backwards compatibility with the existing API.

I took the liberty of correcting a few spelling errors in the process, but added them to the same commit, hope that's ok.

dlsniper commented 4 years ago

Thanks for this. Awsome work 👏

Thank you!

Please add unit tests for the new functions

How could we do this efficiently? I'd rather not duplicate the existing tests to just add a new parameter to them. The existing tests will call both the "old" and "new" functions as well.

amimof commented 4 years ago

@dlsniper I'm working on this PR #20 that adds better coverage reports using https://codecov.io. Once that's merged we can better see what isn't covered here.

amimof commented 4 years ago

@dlsniper Just checked and coverage is ok, no need to add any tests. I'll merge once the review is resolved.

codecov-io commented 4 years ago

Codecov Report

Merging #19 into master will increase coverage by 5.15%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #19      +/-   ##
==========================================
+ Coverage   57.89%   63.04%   +5.15%     
==========================================
  Files           5        5              
  Lines        1140     1299     +159     
==========================================
+ Hits          660      819     +159     
  Misses        240      240              
  Partials      240      240              
Impacted Files Coverage Δ
bridge.go 58.29% <100.00%> (+4.85%) :arrow_up:
group.go 77.96% <100.00%> (+6.22%) :arrow_up:
huego.go 71.20% <100.00%> (+2.23%) :arrow_up:
light.go 77.98% <100.00%> (+6.21%) :arrow_up:
scene.go 71.42% <100.00%> (+11.42%) :arrow_up:

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 4883aa8...0ade15b. Read the comment docs.