michielpost / Q42.HueApi

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

Z coordinate in streaming api #212

Closed Solandus closed 4 years ago

Solandus commented 4 years ago

Hi guys, would it be possible to include the Z coordinate and the corresponding GetTop and GetBottom functions? The data are already transmitted by the standard API but are not yet included in the existing functions. In LightLocations they are already stored.

michielpost commented 4 years ago

I added a GetTop and GetButton function, see this PR: https://github.com/Q42/Q42.HueApi/pull/213 Can you point out where else you need to get the Z coordinate? So I can add it.

Solandus commented 4 years ago

Hm, it should be added to Effects\BasEffects\SinglePointEffect.cs -> So the Distance and Angle functions of the LightLocation Object should be extended for calculation with the Z coordinate. At the moment there is only the X and Y coordinate used. Edit: Well, the Z IsTop property doesn't include 0, X and Y property check for within 0.

michielpost commented 4 years ago

I updated #213 with some changes. I don't think I'm able to change the Angle function. It now explicitly calculates the angle between 2 X, Y points in a 2D space. If I change this to XYZ it will have different results.

Solandus commented 4 years ago

I see. looks good. :)

michielpost commented 4 years ago

This is in release 3.15.0 on NuGet