DexterInd / DexterInd/GrovePi

DHTDigitalSensor.js getHeatIndex errors in npm v 2.1.0

Open
#299 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
494
Forks
472
PR merge metrics
No merged PRs in 30d

Description

After installing v 2.1.0 i am getting error that h is not defined.
Looking into module sources DHTDigitalSensor.js function getHeatIndex has variable h which is not defined:

// adjustment
      if (h < 13 && temp <= 112) {
          heatIndex = heatIndexBase - (13 - hum) / 4 * Math.sqrt((17 - Math.abs(temp - 95)) / 17);
      } else if (h > 85 && temp <= 87) {
          heatIndex = heatIndexBase + ((hum - 85) / 10) * ((87 - temp) / 5)
      } else {
          heatIndex = heatIndexBase;
      }.

I think intent was to use function parameter hum instead of h.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The error is reported in DHTDigitalSensor.js, in the getHeatIndex function shipped with npm v2.1.0. Start by checking the adjustment conditions and confirm the undefined variable reference; done means the function no longer raises the reported error and uses the intended humidity value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
embedded-iot
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.