mirror of
https://github.com/sensebox/blockly-app
synced 2025-10-21 08:03:54 +02:00
remove option to select non-sensebox SSIDs
not of use outside of development, worsens UX
This commit is contained in:
parent
c99ca318de
commit
8af35cd30c
2 changed files with 9 additions and 15 deletions
|
@ -108,11 +108,6 @@
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
||||||
<ion-item>
|
|
||||||
<ion-label>Show only senseBox WiFis</ion-label>
|
|
||||||
<ion-toggle (ngModelChange)="onFilterToggle($event)" [(ngModel)]="filterSsids"></ion-toggle>
|
|
||||||
</ion-item>
|
|
||||||
|
|
||||||
<ng-container *ngIf="state.wifiSelection == 'error'">
|
<ng-container *ngIf="state.wifiSelection == 'error'">
|
||||||
<h2 translate>OTAWIZ.WIFI.AUTO.ERROR</h2>
|
<h2 translate>OTAWIZ.WIFI.AUTO.ERROR</h2>
|
||||||
<p [innerHTML]="errorMsg"></p>
|
<p [innerHTML]="errorMsg"></p>
|
||||||
|
|
|
@ -27,7 +27,6 @@ export class OtaWizardPage implements OnInit, OnDestroy {
|
||||||
offlineSub: Subscription
|
offlineSub: Subscription
|
||||||
|
|
||||||
sketch = ''
|
sketch = ''
|
||||||
filterSsids = true
|
|
||||||
availableSenseboxes: string[] = [] // list of SSIDs
|
availableSenseboxes: string[] = [] // list of SSIDs
|
||||||
compiledSketch: ArrayBuffer = undefined
|
compiledSketch: ArrayBuffer = undefined
|
||||||
errorMsg = ''
|
errorMsg = ''
|
||||||
|
@ -46,12 +45,17 @@ export class OtaWizardPage implements OnInit, OnDestroy {
|
||||||
navParams : NavParams,
|
navParams : NavParams,
|
||||||
private compilerprovider:CompilerProvider
|
private compilerprovider:CompilerProvider
|
||||||
) {
|
) {
|
||||||
this.sketch = navParams.get('sketch')
|
|
||||||
|
|
||||||
// for OTA to work, the new sketch has to include the OTA logic as well.
|
// for OTA to work, the new sketch has to include the OTA logic as well.
|
||||||
// to ensure that, we're prepending it here to the sketch.
|
// to ensure that, we're prepending it here to the sketch.
|
||||||
// this also works regardless wether the sketch already contains this line.
|
// this also works regardless wether the sketch already contains this line.
|
||||||
this.sketch = '#include <SenseBoxOTA.h>\n' + this.sketch
|
this.sketch = '#include <SenseBoxOTA.h>\n'
|
||||||
|
|
||||||
|
// get sketch from router param, or set minimal default code for successful compilation
|
||||||
|
let sketch = navParams.get('sketch')
|
||||||
|
if (!sketch)
|
||||||
|
sketch = 'void setup() {}\nvoid loop() {}\n'
|
||||||
|
|
||||||
|
this.sketch += sketch
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -80,11 +84,6 @@ export class OtaWizardPage implements OnInit, OnDestroy {
|
||||||
this.handleWifiSelection()
|
this.handleWifiSelection()
|
||||||
}
|
}
|
||||||
|
|
||||||
onFilterToggle (newVal) {
|
|
||||||
this.filterSsids = newVal
|
|
||||||
this.handleWifiSelection()
|
|
||||||
}
|
|
||||||
|
|
||||||
onClose () {
|
onClose () {
|
||||||
this.navCtrl.pop()
|
this.navCtrl.pop()
|
||||||
}
|
}
|
||||||
|
@ -155,7 +154,7 @@ export class OtaWizardPage implements OnInit, OnDestroy {
|
||||||
} else {
|
} else {
|
||||||
this.state.wifiSelection = 'scanning'
|
this.state.wifiSelection = 'scanning'
|
||||||
try {
|
try {
|
||||||
this.availableSenseboxes = await this.otaWifi.findSenseboxes(this.filterSsids)
|
this.availableSenseboxes = await this.otaWifi.findSenseboxes(true)
|
||||||
this.state.wifiSelection = 'select'
|
this.state.wifiSelection = 'select'
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.state.wifiSelection = 'error'
|
this.state.wifiSelection = 'error'
|
||||||
|
|
Loading…
Add table
Reference in a new issue