michielpost / Q42.HueApi

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

the Light Api Method TurnOff() can not turn off the light, but the TurnOn() can work well #305

Closed qiuqingpo closed 1 year ago

qiuqingpo commented 1 year ago

My code is below: var req = new UpdateLight().TurnOff(); var reuslt = await _client.UpdateLightAsync(Guid.Parse("d2e20330-302b-4059-bc91-f3621242bb5b"), req); it can not work ,but Turn On can var req = new UpdateLight().TurnOn(); var reuslt = await _client.UpdateLightAsync(Guid.Parse("d2e20330-302b-4059-bc91-f3621242bb5b"), req); can you tell me why? thank you!

michielpost commented 1 year ago

I did a quick test and both TurnOn and TurnOff work as expected. Not sure what the problem is here?

See this test: https://github.com/michielpost/Q42.HueApi/blob/9ad76ed95dc1e4d5507a5befad80ae12c5cd8c50/src/HueApi.Tests/LightTests.cs#L243

qiuqingpo commented 1 year ago

I did a quick test and both TurnOn and TurnOff work as expected. Not sure what the problem is here?

See this test:

https://github.com/michielpost/Q42.HueApi/blob/9ad76ed95dc1e4d5507a5befad80ae12c5cd8c50/src/HueApi.Tests/LightTests.cs#L243 Sorry, I make a mistake,I alter your method, and passing wrong parameters, thank you very much, the libs is very good!

michielpost commented 1 year ago

Thanks, great to hear!