diff --git a/src/module/ws1080.ts b/src/module/ws1080.ts index d628ca4..33ccaf9 100644 --- a/src/module/ws1080.ts +++ b/src/module/ws1080.ts @@ -1,6 +1,5 @@ import { getDeviceList, Device, Interface, InEndpoint } from 'usb'; -const MAX_RAIN_JUMP = 10; const WIND_DIRS = [ 'N', 'NNE', @@ -236,7 +235,7 @@ class WS1080 { // Bytes 14 and 15 when combined create an unsigned short int // that we multiply by 0.3 to find the total rain - let totalRain = currentBlock.subarray(13, 15).readUint16LE() * 0.3; + const totalRain = currentBlock.subarray(13, 15).readUint16LE() * 0.3; // Calculate wind speeds const windSpeed = (wind + ((windExtra & 0x0f) << 8)) * 0.38; // Was 0.1 @@ -251,14 +250,7 @@ class WS1080 { // Calculate rainfall rates if (this.previousRain === 0) this.previousRain = totalRain; - let rainDiff = totalRain - this.previousRain; - - if (rainDiff > MAX_RAIN_JUMP) { - // Filter rainfall spikes - rainDiff = 0; - totalRain = this.previousRain; - } - + const rainDiff = totalRain - this.previousRain; this.previousRain = totalRain; // Compile the data