1
0
Fork 0
mirror of https://github.com/sensebox/blockly-app synced 2025-10-20 23:33:53 +02:00

remove option to select non-sensebox SSIDs

not of use outside of development, worsens UX
This commit is contained in:
Norwin 2019-02-17 13:41:06 +01:00
parent c99ca318de
commit 8af35cd30c
2 changed files with 9 additions and 15 deletions

View file

@ -108,11 +108,6 @@
</ion-item>
</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'">
<h2 translate>OTAWIZ.WIFI.AUTO.ERROR</h2>
<p [innerHTML]="errorMsg"></p>

View file

@ -27,7 +27,6 @@ export class OtaWizardPage implements OnInit, OnDestroy {
offlineSub: Subscription
sketch = ''
filterSsids = true
availableSenseboxes: string[] = [] // list of SSIDs
compiledSketch: ArrayBuffer = undefined
errorMsg = ''
@ -46,12 +45,17 @@ export class OtaWizardPage implements OnInit, OnDestroy {
navParams : NavParams,
private compilerprovider:CompilerProvider
) {
this.sketch = navParams.get('sketch')
// 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.
// 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() {
@ -80,11 +84,6 @@ export class OtaWizardPage implements OnInit, OnDestroy {
this.handleWifiSelection()
}
onFilterToggle (newVal) {
this.filterSsids = newVal
this.handleWifiSelection()
}
onClose () {
this.navCtrl.pop()
}
@ -155,7 +154,7 @@ export class OtaWizardPage implements OnInit, OnDestroy {
} else {
this.state.wifiSelection = 'scanning'
try {
this.availableSenseboxes = await this.otaWifi.findSenseboxes(this.filterSsids)
this.availableSenseboxes = await this.otaWifi.findSenseboxes(true)
this.state.wifiSelection = 'select'
} catch (err) {
this.state.wifiSelection = 'error'