mirror of
https://github.com/sensebox/blockly-app
synced 2025-07-01 08:30:26 +02:00
add defines on input
This commit is contained in:
parent
eb5e7106a5
commit
f472a8733d
2 changed files with 11 additions and 2 deletions
|
@ -62,7 +62,7 @@ const char SENSEBOX_ID[] PROGMEM = "@{SENSEBOX_ID}@";
|
|||
static const uint8_t NUM_SENSORS = @{NUM_SENSORS}@;
|
||||
|
||||
// Connected sensors
|
||||
@{SENSORS|toDefineWithSuffixPrefixAndKey~,_CONNECTED,sensorType}@
|
||||
@{defineSensors}@
|
||||
|
||||
// Sensor SENSOR_IDs
|
||||
// Temperatur
|
||||
|
|
|
@ -52,6 +52,7 @@ export class ConfigurationPage {
|
|||
PASSWORD:this.pw,
|
||||
INGRESS_DOMAIN:"ingress.opensensemap.org",
|
||||
SENSEBOX_ID:this.senseboxid,
|
||||
defineSensors:this.buildDefines(),
|
||||
NUM_SENSORS:this.sensors.length,
|
||||
TEMPERSENSOR_ID:this.temp,
|
||||
RELLUFSENSOR_ID:this.humi,
|
||||
|
@ -61,13 +62,21 @@ export class ConfigurationPage {
|
|||
REGENMSENSOR_ID:this.rain,
|
||||
PM10SENSOR_ID:this.pm10,
|
||||
PM25SENSOR_ID:this.pm25
|
||||
|
||||
};
|
||||
this.http.get("assets/templates/homev2Wifi.tpl",{responseType:"text"}).subscribe(data=>{
|
||||
let sketch = this.applyTemplate(data,values);
|
||||
console.log(sketch)
|
||||
this.navCtrl.push(OtaWizardPage, { sketch })
|
||||
})
|
||||
}
|
||||
|
||||
buildDefines(){
|
||||
let defineString =""
|
||||
this.sensors.map((sensor)=>{
|
||||
defineString+="#define "+sensor.type+"_CONNECTED\n"
|
||||
})
|
||||
return defineString;
|
||||
}
|
||||
addSensor(){
|
||||
let addModal = this.modalCtrl.create(AddItemPage);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue