add iic sensors to cibuild

This commit is contained in:
andreas 2023-11-02 20:48:16 +01:00
parent 6884881bcf
commit f266d3b3db
2 changed files with 78 additions and 2 deletions

View File

@ -343,8 +343,80 @@ types:
max: 255 max: 255
- &iicsensors
type: checkbox
label: I2C
key: i2c
description: 'I2C Bus #1'
values:
- key: true
children:
- <<: *gpiopin
label: SDA
key: sda
mandatory: true
target: "define:GWIIC_SDA"
- <<: *gpiopin
label: SCL
key: scl
mandatory: true
target: "define:GWIIC_SCL"
- type: checkbox
label: SHT3X
description: "SHT30 temperature and humidity sensor"
key: sht3x
values:
- key: true
children:
- type: select
label: address
key: address
target: "define:GWSHT3X"
mandatory: true
default: 68
values:
- label: "default(0x44 - L)"
value: 68
- label: "opt(0x45 - H)"
value: 69
- type: checkbox
label: QMP6988
description: "QMP6988 pressure sensor"
key: qmp6988
values:
- key: true
children:
- type: select
label: address
key: address
target: "define:GWQMP6988"
mandatory: true
default: 86
values:
- label: "default(0x56 - H)"
value: 86
- label: "opt(0x70 - L)"
value: 112
- type: checkbox
label: BME280
description: "BME280 temperature/humidity/pressure sensor"
key: bme280
values:
- key: true
children:
- type: select
label: address
key: address
target: "define:GWBME280"
mandatory: true
default: 118
values:
- label: "default(0x76 - L)"
value: 118
- label: "opt(0x77 - nc)"
value: 119
resources: resources:
default: &esp32default default: &esp32default
@ -395,4 +467,5 @@ config:
- *serial2 - *serial2
- *can - *can
- *resetButton - *resetButton
- *led - *led
- *iicsensors

View File

@ -357,6 +357,9 @@ class PipelineInfo{
*/ */
const buildSelector=(parent,cfgBase,name,current,callback)=>{ const buildSelector=(parent,cfgBase,name,current,callback)=>{
let config=expandObject(cfgBase); let config=expandObject(cfgBase);
if (current === undefined && config.default !== undefined){
current=config.default;
}
let rep=new RegExp("[^"+SEPARATOR+"]*","g"); let rep=new RegExp("[^"+SEPARATOR+"]*","g");
let level=name.replace(rep,''); let level=name.replace(rep,'');
let frame=addEl('div','selector level'+level.length+' t'+config.type,parent); let frame=addEl('div','selector level'+level.length+' t'+config.type,parent);