michielpost / Q42.HueApi

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

DeleteSceneAsync(sceneID) returns null and deletes Scene #179

Closed lagset closed 5 years ago

lagset commented 5 years ago

Hi there,

I am using the API in Unity (2018.3.11f1) to do control the Hue lights using the HoloLens (v1). The API works great so far and makes life much easier, so thanks for that btw.

However, I am facing an issue deleting Scenes. When I call var result = await DeleteSceneAsync(sceneID);

I get an empty result and thus am not able to check in the application whether the deletion was successful or not. Checking with the CLIP API Debugger, I can see that the Scene was deleted successfully on the bridge. Hence, I would expect a result containing SuccessResult, telling me that the operation succeeded instead of an empty result. If I try again to delete it, I then get, correctly, a HueResult with an Error Type 3, telling me that the requested Scene is not available.

Am I misunderstanding the API and an empty HueResult is the correct behaviour and I can just check if it is null and if it is, then I know the operation was successfull? May it be the case that the Newtonsoft.dll of the MixedRealityToolkit (MRTK) interferes and does not Deserialize the HueResult correctly (it does so, when getting the Type 3 Error, however)? If you have any soloutions or hints, be sure to tell me.

Thanks, Valentin

michielpost commented 5 years ago

Thanks. Fixed it. For now you can assume that if the response is null it's a success. In the next release it will release a proper object with a success result.

lagset commented 5 years ago

Awesome, thanks for the quick response and help :)

michielpost commented 5 years ago

This change is published in version 3.10.0, now available on NuGet