michielpost / Q42.HueApi

C# helper library to talk to the Philips Hue bridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Temperature property has wrong JSON property name

RicoSuter opened this issue · comments

The serialization for temperature is broken:

should be "temperature" and not "motion".

Also the temperature value should be a double and not an int:

image

Thanks for letting me know. It's fixed.
The documentation on the Hue site indicates the temperature.temperature property is deprecated. So I removed it completely.
The temperature value can be found in Temperature.TemperatureReport.Temperature.

This change is in version 1.5.2 which is being published to NuGet right now.

With the update I'm no longer able to access the temperature at all:

image

How is the report supposed to be used? Is temperature only available via push data now?

The temperature value can be found in Temperature.TemperatureReport.Temperature.

Yes, but how do I get the TemperatureReport from a TemperatureResource?

So the Temperature class should have a "TemperatureReport" property:

image

public class Temperature 
{
    [JsonPropertyName("temperature_report")]
    public bool TemperatureReport { get; set; }
}

image

Yes, looks like the TemperatureReport was not added with the last update. I fixed it and it's being pushed to NuGet right now.

Btw, would also be nice if the ButtonResource would have the report property:

image

image

(repeat interval and event values also missing)

Just did another update with support for the new Button properties, also added support for CameraMotion, TamperSensor and ContactSensor 👍