naofireblade / homebridge-weather-plus

A comprehensive weather plugin for homebridge.
MIT License
314 stars 63 forks source link

Use unconverted units when comparing wind speed for occupancy detector #89

Closed joconor closed 4 years ago

joconor commented 4 years ago

In saveCharacteristic(), when deciding if the wind speed occupancy detector is to be set, the comparison is performed against a hard-coded trigger value of '4'. But the wind speed value being compared has already been converted to different units (if non-SI units are being used). This PR saves the converted characteristic value without mutating the passed-in value. This leaves the passed in value in unconverted units so it can be used for comparison later without having to also convert the trigger value.

naofireblade commented 4 years ago

Good catch! Thank you.

naofireblade commented 4 years ago

Released in v3.0.4