Skip to content

Commit 7e08b6a

Browse files
authored
Merge pull request #168 from ex-nerd/patch-2
Fix NowCast weight_factor calculation
2 parents 1c501ad + cb9465c commit 7e08b6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/sensor_nowcast_aqi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ script:
221221
// Calculate the weight factor
222222
float range = max - min;
223223
float rate = range / max;
224-
float weight_factor = 1.0 - range;
224+
float weight_factor = 1.0 - rate;
225225
if (weight_factor < 0.5) {
226226
weight_factor = 0.5;
227227
} else if (weight_factor > 1.0) {
@@ -274,7 +274,7 @@ script:
274274
// Calculate the weight factor
275275
float range = max - min;
276276
float rate = range / max;
277-
float weight_factor = 1.0 - range;
277+
float weight_factor = 1.0 - rate;
278278
if (weight_factor < 0.5) {
279279
weight_factor = 0.5;
280280
} else if (weight_factor > 1.0) {

0 commit comments

Comments
 (0)