Closed gkapellmann closed 1 year ago
Hi!
This library follows the Hue API. There is no new v2 API for authenticating with the bridge, so that's why this is not implemented yet. If Hue develops a v2 authentication API, it will be included.
But I do understand that this makes standalone usage of the new v2 HueApi impossible, you will also need a dependency on the old Q42.HueApi just for the authentication part.
So what I can do is also implement authentication in the new HueApi, but that will call the old APIs. Would that help?
I included a LocalHueApi.RegisterAsync static method in version 0.9.1 (now on NuGet). Let me know if this works for you.
Ah ok! Thank you for your answer.
Yes, that will help, I will test in the next few days and let you know how it went.
Thanks!
Yeap, works like a charm now.
One question, what is the "regResult.StreamingClientKey"?
And a request, could "await LocalHueApi.RegisterAsync" implement a cancellation event? I am thinking for a timeout in case the button doesnt get pressed, to be able to catch the timeout, for example:
using (var cancellationTokenSource = new CancellationTokenSource(5000)) { var regResult = await LocalHueApi.RegisterAsync(ipAddress, newUser, ID, cancellationTokenSource.Token); }
The StreamingClientKey
will be filled with the streaming / entertainment key when you send generateClientKey = true
with the RegisterAsync request. It's only needed when you want to use the streaming API.
I also added the cancellationToken. But the user should first press the button, and then do a RegisterAsync request.
If the button is not pressed, it will immediately return with a LinkButtonNotPressedException
OK, thank you!
I'll test and let you know how it goes.
Ok, this works like a charm, Thanks!
Hey, great package!
This is more a question than an issue I guess: Is there a roadmap or an estimate of when will the Authentication might arrive for the API v2?
I know that atm we can do it with the original:
Just wondering to orginize myself, maybe even try to implement it.