brutella / hc

hc is a lightweight framework to develop HomeKit accessories in Go.
Apache License 2.0
1.74k stars 189 forks source link

TemperatureSensor steps ignored #207

Closed jurjevic closed 2 years ago

jurjevic commented 3 years ago

Temperature values are always rounded to 0.5 values. So a temperature of 19.8° will be 20.0° and a temperature of 19.6° will become 19.5° (Celsius units)

I'm just using: t := accessory.NewTemperatureSensor(createInfo("temp", 1234), 0, -55, 55, 0.1) t.TempSensor.CurrentTemperature.SetValue(19.8)

The step value seems to be ignored at all. I would like to see the exact value 19.8° instead of 20.0°. Any fix on this?

brutella commented 2 years ago

The step value seems to be ignored at all.

No. hc does not ignore the step value. The Apple Home app just ignores the exact decimal values and rounds to 0.5. There is nothing we can do, because it's only an issue in the Apple Home app.