michielpost / Q42.HueApi

C# helper library to talk to the Philips Hue bridge
MIT License
411 stars 114 forks source link

"HueClient is not initialized. First call RegisterAsync or Initialize." when calling api/config #133

Closed niels9001 closed 6 years ago

niels9001 commented 6 years ago

How can we get basic Bridge information without registering to the Bridge? The API does support it:

http://*IP*/api/config returns parts of the Bridge config (like Bridge ID, api version etc.). This is useful if you want to show more to the user when connecting to Bridges.

HueClient Client = new LocalHueClient(B.LocalIP); Bridge x = await Client.GetBridgeAsync();

doesn't work. The above error returns.

michielpost commented 6 years ago

This is possible since version 3.5.2. See issue: https://github.com/Q42/Q42.HueApi/issues/126 You should use GetConfigAsync