Skip to content

Commit

Permalink
Fix for VOC readings from local sensors (#66)
Browse files Browse the repository at this point in the history
* Fix for VOC readings from local sensors

* Bump the version
  • Loading branch information
jmkk authored Feb 17, 2024
1 parent 7410d7c commit 3bb0fa7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ sudo npm publish


# Changelog
- 3.0.1: Fixed fetching VOC for local sensors
- 3.0.0: Major rewwrite to convert to the Platform plugin. Added humidity and temperatures reporting. Added ALT-CF3 conversion.
- 2.1.0: Only fetch API fields needed for the core functionality of the plugin.
- 2.0.2: Verbose network error logging.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": false,
"displayName": "Homebridge PurpleAir Sensor",
"name": "homebridge-purpleair-sensor",
"version": "3.0.0",
"version": "3.0.1",
"description": "Monitor air quality using PurpleAir.",
"license": "Apache-2.0",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion src/SensorReading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ function parseLocalPurpleAirJson(data, averages?: string, conversion?: string) {
const humidity = parseFloat(data.current_humidity) + 4;
const sensor = data.Id;
const temperature = convertTemperatureToCelcius(parseFloat(data.current_temp_f));
return new SensorReading(sensor, pm25, pm25Cf1, humidity, temperature, null, conv, pm25alt);
const voc = data.gas_680 ? parseFloat(data.gas_680) : null;
return new SensorReading(sensor, pm25, pm25Cf1, humidity, temperature, voc, conv, pm25alt);
}

function getPM25(sensor_data, sensor_stats, averages) {
Expand Down

0 comments on commit 3bb0fa7

Please sign in to comment.