amimof / huego

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

Adds method that allows to identify a light optically #46

Closed skroczek closed 2 years ago

skroczek commented 3 years ago

I noticed while experimenting with the library that the function to identify a light is missing. It is very similar to the SetLightState method, but unfortunately the functionality cannot be achieved through it. I think it's mainly because the State always has the "On" property set when serializing to a json object.

amimof commented 3 years ago

@skroczek Thansk for this contribution. This is a nice addition to the library. I'd like to see a test covering your code. Other than that, looks awesome.

codecov-commenter commented 2 years ago

Codecov Report

Merging #46 (d6af478) into master (66b4d4e) will increase coverage by 3.71%. The diff coverage is 64.70%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
+ Coverage   69.71%   73.42%   +3.71%     
==========================================
  Files           5        5              
  Lines        1215     1430     +215     
==========================================
+ Hits          847     1050     +203     
- Misses        201      210       +9     
- Partials      167      170       +3     
Impacted Files Coverage Δ
bridge.go 63.82% <64.70%> (+4.25%) :arrow_up:
group.go 100.00% <0.00%> (ø)
light.go 100.00% <0.00%> (ø)
scene.go 100.00% <0.00%> (ø)
huego.go 77.60% <0.00%> (+3.05%) :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 66b4d4e...d6af478. Read the comment docs.

skroczek commented 2 years ago

@amimof thank you very much for your patience. I was very busy in the last months, so I could only now take care of the testing. I hope I have chosen the right tests. If I can improve something, I would be very happy about a feedback.