@sensebox/sketch-templater
Advanced tools
Comparing version 1.11.2 to 1.12.0
@@ -5,2 +5,6 @@ # node-sketch-templater Changelog | ||
## v1.12.0 | ||
- đ§ Fix variable naming | ||
## v1.11.2 | ||
@@ -7,0 +11,0 @@ - đ§ Fix BME680_CONNECTED issue |
{ | ||
"name": "@sensebox/sketch-templater", | ||
"version": "1.11.2", | ||
"version": "1.12.0", | ||
"description": "nodejs library to create senseBox Arduino Sketches", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -11,4 +11,4 @@ 'use strict'; | ||
const output = []; | ||
for (const [i, { _id, title }] of sensors.entries()) { | ||
output.push(dedent`// ${title} | ||
for (const [i, { _id, title, sensorType }] of sensors.entries()) { | ||
output.push(dedent`// ${title} - ${sensorType} | ||
#define SENSOR${i + 1}_ID "${_id}"`); | ||
@@ -23,3 +23,3 @@ } | ||
const value = sensor[key].replace(/\s+/g, ''); | ||
output.push(dedent`// ${sensor.title} | ||
output.push(dedent`// ${sensor.title} - ${sensor.sensorType} | ||
#define ${prefix}${value.toUpperCase()}${suffix}`); | ||
@@ -32,2 +32,14 @@ } | ||
const output = []; | ||
for (const { _id, title, sensorType } of sensors) { | ||
output.push(dedent`// ${title} - ${sensorType} | ||
const char ${sensorType.toUpperCase()}_${title | ||
.toUpperCase() | ||
.replace(/[^A-Z0-9]+/g, '') | ||
.slice(0, 6)}SENSOR_ID[] PROGMEM = "${_id}";`); | ||
} | ||
return output.join('\r\n'); | ||
}, | ||
toProgmemWithoutPrefix(sensors) { | ||
const output = []; | ||
for (const { _id, title } of sensors) { | ||
@@ -71,15 +83,14 @@ output.push(dedent`// ${title} | ||
return `{${chunks.map(c => ` 0x${c}`)} }`; | ||
return `{${chunks.map((c) => ` 0x${c}`)} }`; | ||
}, | ||
toDefineDisplay(display){ | ||
toDefineDisplay(display) { | ||
const output = []; | ||
if(display === 'true'){ | ||
if (display === 'true') { | ||
output.push(`#define DISPLAY128x64_CONNECTED`); | ||
} | ||
else{ | ||
} else { | ||
output.push(`//#define DISPLAY128x64_CONNECTED`); | ||
} | ||
return output.join('\r\n'); | ||
return output.join('\r\n'); | ||
} | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149234
275