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 Hue v2 support for the upcoming v2.0.0 release #52

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

amimof
Copy link
Owner

@amimof amimof commented Jan 12, 2022

Adds support for Hue API V2

Features

  • Currently V2 work is under the v2/. Folder structure is not final at this point and is sobject to change
  • Introduces the new Client struct which is the type used to interact with the Hue API. Instead of using the Bridge type. The Bridge type is now just a regular struct that represents the bridge resource in the V2 API.
  • Support for both V1 & V2 API. This is possible because we have 1 client per version. ClientV1 and ClientV2 and in the future ClientVX.
  • Huego Clients uses the new CLIPClient which is a general purpose HTTP client. Sort of like a REST client but for Hue briges specifically.
  • The CLIPClient uses Request & Response types to communicate with Hue briges through a Client type.
  • Users may pass in their own http.Client if they want.

Progress

  • light
  • scene
  • room
  • zone
  • bridge_home
  • grouped_light
  • device
  • bridge
  • device_power
  • zigbee_connectivity
  • zgp_connectivity
  • motion
  • temperature
  • light_level
  • button
  • behavior_script
  • behavior_instance
  • geofence_client
  • geolocation
  • entertainment_configuration
  • entertainment
  • homekit

@amimof amimof mentioned this pull request Jan 12, 2022
1 task
@codecov-commenter
Copy link

codecov-commenter commented Jan 12, 2022

Codecov Report

Merging #52 (ef38c24) into master (5668ae6) will decrease coverage by 8.73%.
The diff coverage is 35.07%.

@@            Coverage Diff             @@
##           master      #52      +/-   ##
==========================================
- Coverage   73.53%   64.80%   -8.74%     
==========================================
  Files           5       12       +7     
  Lines        1436     1858     +422     
==========================================
+ Hits         1056     1204     +148     
- Misses        210      462     +252     
- Partials      170      192      +22     
Impacted Files Coverage Δ
v2/room.go 0.00% <0.00%> (ø)
v2/zone.go 0.00% <0.00%> (ø)
v2/clientv2.go 15.78% <15.78%> (ø)
v2/scene.go 28.57% <28.57%> (ø)
v2/light.go 46.15% <46.15%> (ø)
v2/huego.go 52.00% <52.00%> (ø)
v2/client.go 55.26% <55.26%> (ø)

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 5668ae6...ef38c24. Read the comment docs.

* Work in progress
* V2 version of huego is under `v2/`
The `io.NopCloser` constructor is not available in Go 1.15
* You may now use one `Client` for many `Requests`
* Users may provide their own custom `http.Client`
* Client is just a simple generic HTTP rest client
* A client implementation for each version of the API with the SDK-level interfaces
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

2 participants