Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  added c02-alert-treshold configuration option
  • Loading branch information
Sebastian Kroll committed Jan 19, 2019
2 parents b5c595e + 041fe5e commit 1e8cad4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## version history

### 0.4.3
- added configuration-option to override the alert-state threshold for the extra co2-sensors (https://github.com/skrollme/homebridge-eveatmo/issues/24)

### 0.4.2
- hopefully fixed a problem which caused the low-battery warning to persist even after replacing the module's battery (https://github.com/skrollme/homebridge-eveatmo/issues/21)

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Because this plugin's base was taken from [homebridge-netatmo](https://github.co
"platform": "eveatmo",
"name": "eveatmo platform",
"extra_co2_sensor": false,
"co2_alert_threshold": 1000,
"ttl": 540,
"auth": {
"client_id": "XXXXX Create at https://dev.netatmo.com/",
"client_secret": "XXXXX Create at https://dev.netatmo.com/",
Expand All @@ -29,6 +31,7 @@ Because this plugin's base was taken from [homebridge-netatmo](https://github.co
```

- **extra_co2_sensor: (optional)** Adds an extra CO2 sensor which is available via Apple's stock Home.app, too. Default value is *false*
- **co2_alert_threshold (optional):** Sets the co2-level [ppm] at which the sensors switch to alert-state
- **ttl: (optional)** Seconds between two Netatmo API polls. Lower is not neccessarily better! The weatherstation itself collects one value per 5minutes, so going below 300s makes no sense. Default value is *540* (=9min)
- **auth:** Credentials for the Netatmo API

Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class EveatmoPlatform {
this.foundAccessories = [];

this.config.extra_co2_sensor = typeof config.extra_co2_sensor !== 'undefined' ? Boolean(config.extra_co2_sensor) : false;
this.config.co2_alert_threshold = typeof config.co2_alert_threshold !== 'undefined' ? parseInt(config.co2_alert_threshold) : 1000;

// If this log message is not seen, most likely the config.js is not found.
this.log.debug('Creating EveatmoPlatform');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-eveatmo",
"version": "0.4.2",
"version": "0.4.3",
"description": "Homebridge plugin which adds a Netatmo weatherstation as HomeKit device and tries to act like Elgato Eve Room/Weather",
"license": "ISC",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion service/eveatmo-co2.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function(pHomebridge) {
}

transformCO2ToCarbonDioxideDetected() {
return (this.accessory.co2 > 1000 ? Characteristic.CarbonDioxideDetected.CO2_LEVELS_ABNORMAL : Characteristic.CarbonDioxideDetected.CO2_LEVELS_NORMAL);
return (this.accessory.co2 >= this.accessory.config.co2_alert_threshold ? Characteristic.CarbonDioxideDetected.CO2_LEVELS_ABNORMAL : Characteristic.CarbonDioxideDetected.CO2_LEVELS_NORMAL);
}
}

Expand Down

0 comments on commit 1e8cad4

Please sign in to comment.