peted-davis / WeatherFlow_PiConsole

Raspberry Pi Python console for WeatherFlow Tempest and Smart Home Weather Stations
GNU General Public License v3.0
156 stars 20 forks source link

Barometric pressure trend shows positive value when pressure is slowly falling #110

Closed karlkec closed 10 months ago

karlkec commented 1 year ago

Describe the bug When the barometric pressure trend is slowly falling, the pressure change shows as a positive number.

To Reproduce Steps to reproduce the behavior:

  1. Set pressure units to inHg
  2. Wait for barometric pressure to be slowly falling
  3. Over the period of an hour or two, manually record SLP pressure and numeric Trend value from the console, to confirm slowly falling SLP.
  4. Note that the numeric trend value shows a positive number.

I think under these conditions the trend value should be negative.

Hardware/OS/Version:

Suggested Resolution In lib/observationFormat.py line 258, I'm guessing the round() and subsequent abs() functions are used to prevent a negative sign preceeding a zero value. In this case, the inHg/hr pressure trend value is displayed to three digits. So I think the second argument to round() should be changed from 1 to 3, to match the number of digits displayed. Similarly, in line 263, I think the second argument to round() should be 2, for mmHg/hr.

peted-davis commented 1 year ago

Good spot - I think the rounding issue you identified is the culprit. I will get this fixed up in the next version

peted-davis commented 10 months ago

This is now fixed in v23.10.1