Skip to content

Commit 23f895a

Browse files
felixerdydependabot-preview[bot]umut0
authored
CO2 Sensor (#367)
* 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]>
1 parent a142f5b commit 23f895a

File tree

8 files changed

+33
-14
lines changed

8 files changed

+33
-14
lines changed

packages/api/lib/controllers/boxesController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ const getBox = async function getBox (req, res, next) {
381381
* @apiParam (RequestBody) {Location} location the coordinates of this senseBox.
382382
* @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.
383383
* @apiParam (RequestBody) {Sensor[]} [sensors] an array containing the sensors of this senseBox. Only use if `model` is unspecified.
384-
* @apiParam (RequestBody) {String="hdc1080","bmp280","tsl45315","veml6070","sds011","bme680","smt50","soundlevelmeter", "windspeed"} [sensorTemplates] Specify which sensors should be included.
384+
* @apiParam (RequestBody) {String="hdc1080","bmp280","tsl45315","veml6070","sds011","bme680","smt50","soundlevelmeter", "windspeed", "scd30"} [sensorTemplates] Specify which sensors should be included.
385385
* @apiParam (RequestBody) {Object} [mqtt] specify parameters of the MQTT integration for external measurement upload. Please see below for the accepted parameters
386386
* @apiParam (RequestBody) {Object} [ttn] specify parameters for the TTN integration for measurement from TheThingsNetwork.org upload. Please see below for the accepted parameters
387387
* @apiParam (RequestBody) {Boolean="true","false"} [useAuth] whether to use access_token or not for authentication
@@ -541,7 +541,7 @@ module.exports = {
541541
{ name: 'exposure', allowedValues: Box.BOX_VALID_EXPOSURES },
542542
{ name: 'model', allowedValues: Box.BOX_VALID_MODELS },
543543
{ name: 'sensors', dataType: ['object'] },
544-
{ name: 'sensorTemplates', dataType: ['String'], allowedValues: ['hdc1080', 'bmp280', 'sds 011', 'tsl45315', 'veml6070', 'bme680', 'smt50', 'soundlevelmeter', 'windspeed'] },
544+
{ name: 'sensorTemplates', dataType: ['String'], allowedValues: ['hdc1080', 'bmp280', 'sds 011', 'tsl45315', 'veml6070', 'bme680', 'smt50', 'soundlevelmeter', 'windspeed', 'scd30'] },
545545
{ name: 'serialPort', dataType: 'String', defaultValue: 'Serial1', allowedValues: ['Serial1', 'Serial2'] },
546546
{ name: 'soilDigitalPort', dataType: 'String', defaultValue: 'A', allowedValues: ['A', 'B', 'C'] },
547547
{ name: 'soundMeterPort', dataType: 'String', defaultValue: 'B', allowedValues: ['A', 'B', 'C'] },

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Norwin Roosen"
1111
],
1212
"dependencies": {
13-
"@sensebox/opensensemap-api-models": "^0.0.26-beta.0",
13+
"@sensebox/opensensemap-api-models": "^0.0.26",
1414
"@turf/area": "^6.0.1",
1515
"@turf/bbox": "^6.0.1",
1616
"@turf/centroid": "^6.0.2",

packages/models/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## Unreleased
44

5+
## v0.0.26
6+
- Update @sensebox/node-sketch-templater to v1.8.3
7+
8+
## v0.0.26-beta.2
9+
10+
## v0.0.26-beta.1
11+
512
## v0.0.26-beta.0
613
- Authorization
714

packages/models/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@sensebox/opensensemap-api-models",
33
"description": "openSenseMap data models and database connection",
4-
"version": "0.0.26-beta.0",
4+
"version": "0.0.26",
55
"main": "index.js",
66
"license": "MIT",
77
"dependencies": {
88
"@sensebox/osem-protos": "^1.1.0",
9-
"@sensebox/sketch-templater": "^1.8.3-beta.0",
9+
"@sensebox/sketch-templater": "^1.8.3",
1010
"bcrypt": "^5.0.0",
1111
"bunyan": "^1.8.14",
1212
"config": "^3.3.2",

packages/models/src/box/sensorLayouts/sensebox.home.mcu.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const {
1717
smt50_soilmoisture,
1818
smt50_soiltemperature,
1919
soundlevelmeter,
20-
windspeed
20+
windspeed,
21+
scd30_co2
2122
} = sensorDefinitions;
2223

2324
module.exports = [
@@ -35,5 +36,6 @@ module.exports = [
3536
smt50_soilmoisture,
3637
smt50_soiltemperature,
3738
soundlevelmeter,
38-
windspeed
39+
windspeed,
40+
scd30_co2
3941
];

packages/models/src/box/sensorLayouts/sensorDefinitions/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const veml6070_uvintensity = require('./veml6070_uvintensity'),
3939
smt50_soilmoisture = require('./smt50_soilmoisture'),
4040
smt50_soiltemperature = require('./smt50_soiltemperature'),
4141
soundlevelmeter = require('./soundlevelmeter'),
42-
windspeed = require('./windspeed');
42+
windspeed = require('./windspeed'),
43+
scd30_co2 = require('./scd30_co2')
4344

4445
module.exports = {
4546
hdc1008_temperature,
@@ -81,5 +82,6 @@ module.exports = {
8182
smt50_soilmoisture,
8283
smt50_soiltemperature,
8384
soundlevelmeter,
84-
windspeed
85+
windspeed,
86+
scd30_co2
8587
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
module.exports = {
4+
title: 'CO₂',
5+
unit: 'ppm',
6+
sensorType: 'SCD30',
7+
icon: 'osem-co2'
8+
};

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
resolved "https://registry.yarnpkg.com/@sensebox/osem-protos/-/osem-protos-1.1.0.tgz#a7de8bc6be867953f1309181a012063c23299e79"
4343
integrity sha512-H+nUVcWlT0dvIqfJnYHuX9JBcCkP1ZKGE5YTRNWPbAEdZ11h+srpQsmeI58wK5hJcdukaZAjc4Dy96IeGM77aA==
4444

45-
"@sensebox/sketch-templater@^1.8.3-beta.0":
46-
version "1.8.3-beta.0"
47-
resolved "https://registry.yarnpkg.com/@sensebox/sketch-templater/-/sketch-templater-1.8.3-beta.0.tgz#7eccf67469725741dc4a55fcf43f872dd37e1409"
48-
integrity sha512-nsVkMmqr6tDJ4x48qiLyFOAJL1LLhavtg5dksqJa7qeFXQ2AHMmUC8uiU9r2PstANFDDRUDqFZ2rN69rl+NYog==
45+
"@sensebox/sketch-templater@^1.8.3":
46+
version "1.8.3"
47+
resolved "https://registry.yarnpkg.com/@sensebox/sketch-templater/-/sketch-templater-1.8.3.tgz#16fe48afdd2e472ab443e5d21890b59ec8701cd9"
48+
integrity sha512-oKKgv6foFzoiTcyCeZEnycOshyE5owh8Xsjk3a0YuhfG+pLwd9EN4maV7jW6IPcmtSXtaTEICoB+H9K7DiAyLQ==
4949
dependencies:
5050
config "^1.29.2"
5151
dedent "^0.7.0"
@@ -3274,7 +3274,7 @@ simple-statistics@^7.3.1:
32743274
version "7.3.1"
32753275
resolved "https://registry.yarnpkg.com/simple-statistics/-/simple-statistics-7.3.1.tgz#12cac547a075ed718662eabf427894ec6a3a0396"
32763276
integrity sha512-8RktUtizYSzj8vRIvEF8jpHiUcRz3MW/2pppzm0emrEQ3JaV10Kp0DCn4zj4QOCLL4pe/QQ03g88Oy+UbyNSqQ==
3277-
3277+
32783278
slice-ansi@^2.1.0:
32793279
version "2.1.0"
32803280
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636"

0 commit comments

Comments
 (0)