Skip to content

Commit

Permalink
CO2 Sensor (#367)
Browse files Browse the repository at this point in the history
* fix download in getData closes #325 (#349) (#350)

* v9.6.0 Authentication (#363)

* fix download in getData closes #325 (#349)

* Bump simple-statistics from 7.2.0 to 7.3.0 (#352)

Bumps [simple-statistics](https://github.com/simple-statistics/simple-statistics) from 7.2.0 to 7.3.0.
- [Release notes](https://github.com/simple-statistics/simple-statistics/releases)
- [Changelog](https://github.com/simple-statistics/simple-statistics/blob/master/CHANGELOG.md)
- [Commits](simple-statistics/simple-statistics@v7.2.0...v7.3.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* [Security] Bump bl from 1.2.2 to 1.2.3 (#353)

Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. **This update includes a security fix.**
- [Release notes](https://github.com/rvagg/bl/releases)
- [Commits](rvagg/bl@v1.2.2...v1.2.3)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump got from 11.6.0 to 11.6.2 (#354)

Bumps [got](https://github.com/sindresorhus/got) from 11.6.0 to 11.6.2.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](sindresorhus/got@v11.6.0...v11.6.2)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump moment from 2.27.0 to 2.28.0 (#355)

Bumps [moment](https://github.com/moment/moment) from 2.27.0 to 2.28.0.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](moment/moment@2.27.0...2.28.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump got from 11.6.2 to 11.7.0 (#356)

Bumps [got](https://github.com/sindresorhus/got) from 11.6.2 to 11.7.0.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](sindresorhus/got@v11.6.2...v11.7.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump moment from 2.28.0 to 2.29.0 (#357)

Bumps [moment](https://github.com/moment/moment) from 2.28.0 to 2.29.0.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](moment/moment@2.28.0...2.29.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump config from 3.3.1 to 3.3.2 (#358)

Bumps [config](https://github.com/lorenwest/node-config) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/lorenwest/node-config/releases)
- [Changelog](https://github.com/lorenwest/node-config/blob/master/History.md)
- [Commits](https://github.com/lorenwest/node-config/commits)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump moment from 2.29.0 to 2.29.1 (#359)

Bumps [moment](https://github.com/moment/moment) from 2.29.0 to 2.29.1.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](moment/moment@2.29.0...2.29.1)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Auth (#362)

* fix download in getData closes #325 (#349) (#350)

* initial auth for boxes

* auth for boxes that have not opt out

* fix spelling

* useAuth in updateBox

* update access_token via generate_access_token

* pass access_token to sketch templater

* bump node-sketch-templater version (beta)

* add authorization header anyways

* auth beta

* include useAuth in includeSecret requests

* remove default true for useAuth, set true for new Boxes

* update tests for auth feature, fix errors in auth code

* add access_token to getSketch of newSketch email

* update documentation 📜

* remove custom boxes from useAuth=true

* add onlyValue in measurement controller

* test for onlyValue feature

* remove console.log

Co-authored-by: Umut Tas <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Umut Tas <[email protected]>

* add co2 sensor

* add co2 sensor

* rename CO2 to CO₂

* update api models (beta)

* bump node-sketch-templater beta

* update api models (beta)

* bump api-models version

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Umut Tas <[email protected]>
  • Loading branch information
3 people authored Oct 29, 2020
1 parent a142f5b commit 23f895a
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/api/lib/controllers/boxesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ const getBox = async function getBox (req, res, next) {
* @apiParam (RequestBody) {Location} location the coordinates of this senseBox.
* @apiParam (RequestBody) {String="homeV2Lora","homeV2Ethernet","homeV2Wifi","homeEthernet","homeWifi","homeEthernetFeinstaub","homeWifiFeinstaub","luftdaten_sds011","luftdaten_sds011_dht11","luftdaten_sds011_dht22","luftdaten_sds011_bmp180","luftdaten_sds011_bme280","hackair_home_v2"} [model] specify the model if you want to use a predefined senseBox model, autocreating sensor definitions.
* @apiParam (RequestBody) {Sensor[]} [sensors] an array containing the sensors of this senseBox. Only use if `model` is unspecified.
* @apiParam (RequestBody) {String="hdc1080","bmp280","tsl45315","veml6070","sds011","bme680","smt50","soundlevelmeter", "windspeed"} [sensorTemplates] Specify which sensors should be included.
* @apiParam (RequestBody) {String="hdc1080","bmp280","tsl45315","veml6070","sds011","bme680","smt50","soundlevelmeter", "windspeed", "scd30"} [sensorTemplates] Specify which sensors should be included.
* @apiParam (RequestBody) {Object} [mqtt] specify parameters of the MQTT integration for external measurement upload. Please see below for the accepted parameters
* @apiParam (RequestBody) {Object} [ttn] specify parameters for the TTN integration for measurement from TheThingsNetwork.org upload. Please see below for the accepted parameters
* @apiParam (RequestBody) {Boolean="true","false"} [useAuth] whether to use access_token or not for authentication
Expand Down Expand Up @@ -541,7 +541,7 @@ module.exports = {
{ name: 'exposure', allowedValues: Box.BOX_VALID_EXPOSURES },
{ name: 'model', allowedValues: Box.BOX_VALID_MODELS },
{ name: 'sensors', dataType: ['object'] },
{ name: 'sensorTemplates', dataType: ['String'], allowedValues: ['hdc1080', 'bmp280', 'sds 011', 'tsl45315', 'veml6070', 'bme680', 'smt50', 'soundlevelmeter', 'windspeed'] },
{ name: 'sensorTemplates', dataType: ['String'], allowedValues: ['hdc1080', 'bmp280', 'sds 011', 'tsl45315', 'veml6070', 'bme680', 'smt50', 'soundlevelmeter', 'windspeed', 'scd30'] },
{ name: 'serialPort', dataType: 'String', defaultValue: 'Serial1', allowedValues: ['Serial1', 'Serial2'] },
{ name: 'soilDigitalPort', dataType: 'String', defaultValue: 'A', allowedValues: ['A', 'B', 'C'] },
{ name: 'soundMeterPort', dataType: 'String', defaultValue: 'B', allowedValues: ['A', 'B', 'C'] },
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"Norwin Roosen"
],
"dependencies": {
"@sensebox/opensensemap-api-models": "^0.0.26-beta.0",
"@sensebox/opensensemap-api-models": "^0.0.26",
"@turf/area": "^6.0.1",
"@turf/bbox": "^6.0.1",
"@turf/centroid": "^6.0.2",
Expand Down
7 changes: 7 additions & 0 deletions packages/models/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

## v0.0.26
- Update @sensebox/node-sketch-templater to v1.8.3

## v0.0.26-beta.2

## v0.0.26-beta.1

## v0.0.26-beta.0
- Authorization

Expand Down
4 changes: 2 additions & 2 deletions packages/models/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@sensebox/opensensemap-api-models",
"description": "openSenseMap data models and database connection",
"version": "0.0.26-beta.0",
"version": "0.0.26",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@sensebox/osem-protos": "^1.1.0",
"@sensebox/sketch-templater": "^1.8.3-beta.0",
"@sensebox/sketch-templater": "^1.8.3",
"bcrypt": "^5.0.0",
"bunyan": "^1.8.14",
"config": "^3.3.2",
Expand Down
6 changes: 4 additions & 2 deletions packages/models/src/box/sensorLayouts/sensebox.home.mcu.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const {
smt50_soilmoisture,
smt50_soiltemperature,
soundlevelmeter,
windspeed
windspeed,
scd30_co2
} = sensorDefinitions;

module.exports = [
Expand All @@ -35,5 +36,6 @@ module.exports = [
smt50_soilmoisture,
smt50_soiltemperature,
soundlevelmeter,
windspeed
windspeed,
scd30_co2
];
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ const veml6070_uvintensity = require('./veml6070_uvintensity'),
smt50_soilmoisture = require('./smt50_soilmoisture'),
smt50_soiltemperature = require('./smt50_soiltemperature'),
soundlevelmeter = require('./soundlevelmeter'),
windspeed = require('./windspeed');
windspeed = require('./windspeed'),
scd30_co2 = require('./scd30_co2')

module.exports = {
hdc1008_temperature,
Expand Down Expand Up @@ -81,5 +82,6 @@ module.exports = {
smt50_soilmoisture,
smt50_soiltemperature,
soundlevelmeter,
windspeed
windspeed,
scd30_co2
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

module.exports = {
title: 'CO₂',
unit: 'ppm',
sensorType: 'SCD30',
icon: 'osem-co2'
};
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
resolved "https://registry.yarnpkg.com/@sensebox/osem-protos/-/osem-protos-1.1.0.tgz#a7de8bc6be867953f1309181a012063c23299e79"
integrity sha512-H+nUVcWlT0dvIqfJnYHuX9JBcCkP1ZKGE5YTRNWPbAEdZ11h+srpQsmeI58wK5hJcdukaZAjc4Dy96IeGM77aA==

"@sensebox/sketch-templater@^1.8.3-beta.0":
version "1.8.3-beta.0"
resolved "https://registry.yarnpkg.com/@sensebox/sketch-templater/-/sketch-templater-1.8.3-beta.0.tgz#7eccf67469725741dc4a55fcf43f872dd37e1409"
integrity sha512-nsVkMmqr6tDJ4x48qiLyFOAJL1LLhavtg5dksqJa7qeFXQ2AHMmUC8uiU9r2PstANFDDRUDqFZ2rN69rl+NYog==
"@sensebox/sketch-templater@^1.8.3":
version "1.8.3"
resolved "https://registry.yarnpkg.com/@sensebox/sketch-templater/-/sketch-templater-1.8.3.tgz#16fe48afdd2e472ab443e5d21890b59ec8701cd9"
integrity sha512-oKKgv6foFzoiTcyCeZEnycOshyE5owh8Xsjk3a0YuhfG+pLwd9EN4maV7jW6IPcmtSXtaTEICoB+H9K7DiAyLQ==
dependencies:
config "^1.29.2"
dedent "^0.7.0"
Expand Down Expand Up @@ -3274,7 +3274,7 @@ simple-statistics@^7.3.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/simple-statistics/-/simple-statistics-7.3.1.tgz#12cac547a075ed718662eabf427894ec6a3a0396"
integrity sha512-8RktUtizYSzj8vRIvEF8jpHiUcRz3MW/2pppzm0emrEQ3JaV10Kp0DCn4zj4QOCLL4pe/QQ03g88Oy+UbyNSqQ==

slice-ansi@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636"
Expand Down

0 comments on commit 23f895a

Please sign in to comment.