-
Notifications
You must be signed in to change notification settings - Fork 12
/
index_features.html
489 lines (469 loc) · 15.2 KB
/
index_features.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
<!DOCTYPE html>
<html lang="en" class="">
<head>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<title>Install Tasmota</title>
<style>
div,fieldset,input,select{padding:5px;font-size:1em;}
fieldset{background:#4f4f4f;}
p{margin:0.5em 0;}
input{width:100%;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;background:#dddddd;color:#000000;}
input[type=checkbox],input[type=radio]{width:1em;margin-right:6px;vertical-align:-1px;}
input[type=range]{width:99%;}
select{width:100%;background:#dddddd;color:#000000;}
textarea{resize:vertical;width:98%;height:318px;padding:5px;overflow:auto;background:#1f1f1f;color:#65c115;}
body{text-align:center;font-family:verdana,sans-serif;background:#252525;}
td{padding:0px;}
button{border:0;border-radius:0.3rem;background:#1fa3ec;color:#faffff;line-height:2.4rem;font-size:1.2rem;width:100%;-webkit-transition-duration:0.4s;transition-duration:0.4s;cursor:pointer;}
button:hover{background:#0e70a4;}
.bred{background:#d43535;}
.bred:hover{background:#931f1f;}
.bgrn{background:#47c266;}
.bgrn:hover{background:#5aaf6f;}
a{color:#1fa3ec;text-decoration:none;}
.p{float:left;text-align:left;}
.q{float:right;text-align:right;}
.r{border-radius:0.3em;padding:2px;margin:6px 2px;}
.pick-variant{margin-bottom:16px;}
</style>
<style>
.accordion {
outline: none;
transition: 0.4s;
}
.active, .accordion:hover {
background-color: #ccc;
}
.panel {
border-radius:0;
padding: 0 18px;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
</style>
<script
type="module"
src="https://unpkg.com/tasmota-esp-web-tools@8.1.2/dist/web/install-button.js?module"
></script>
<script>
var backup_data; //fetch once, filter a copy on demand
var selected_soc = ["ESP8266","ESP32","ESP32-S2","ESP32-S3","ESP32-C3"];
function show_features(path){
console.log(path);
var feature_report=document.querySelector("#feature_report");
var feature_panel=feature_report.nextElementSibling;
feature_report.innerHTML = '';
var features = {}
for(section of Object.entries(backup_data)){
// console.log(section);
for(entry of backup_data[section[0]]){
// console.log(entry['path']);
if(entry['path'] === path){
features = entry['features']
}
}
}
if(features['Xdrv'].length ==0){
return;
}
var acc_button = document.createElement('button');
acc_button.innerHTML = 'Show additional Debug Info for Developers'
acc_button.setAttribute("class", "accordion");
feature_report.appendChild(acc_button);
var feature_panel = document.createElement('div');
feature_panel.setAttribute("class", "panel");
var feature_msg = document.createElement('p');
feature_msg.innerText = "The following drivers are included in the selected firmware:";
feature_panel.appendChild(feature_msg);
feature_report.appendChild(feature_panel);
// feature_report.setAttribute('hidden','false');
for(section of Object.entries(features)){
acc_button = document.createElement('button');
acc_button.innerHTML = section[0];
acc_button.setAttribute("class", "accordion");
feature_panel.appendChild(acc_button);
acc_panel = document.createElement('div');
acc_panel.setAttribute("class", "panel");
for(entry of features[section[0]]){
if(driver_info[section[0]][entry] == null){
continue;
}
_p = document.createElement('p');
_p.innerHTML = driver_info[section[0]][entry] + ' (driver code: ' +entry + ' )';
acc_panel.appendChild(_p);
console.log(driver_info[section[0]][entry]);
}
feature_panel.appendChild(acc_panel);
feature_panel.appendChild(document.createElement('p'));
}
addEvtListFeatureReport();
console.log(features);
}
function makeSelector(){
fetch('https://tasmota.github.io/install/manifests_new.json')
.then(response => response.json())
.then(data => {backup_data = data; make_select(data)});
}
function make_select(data){
var sel=document.querySelector("#pick-variant-selector");
// console.log(data);
for (opt_group in data){
var og=document.createElement('optgroup');
og.label = opt_group;
sel.appendChild(og);
// console.log(opt_group,data[opt_group]);
for (fw of data[opt_group]){
// console.log(data[opt_group][fw]);
var opt=document.createElement('option');
opt.label = fw['name'];
opt.value = fw['path'];
opt.title = "Supported chipfamilies:\n"
for (chipFamily of fw['chipFamilies']){
opt.title += chipFamily + "\n";
}
// console.log( opt.value);
og.appendChild(opt);
}
}
}
function makeChipSelector(){
const chipSel = document.querySelector("#selected_chip");
var opt=document.createElement('option');
opt.label = 'All';
opt.value = 'All';
opt.title = "All chipfamilies"
chipSel.appendChild(opt);
for(chip of selected_soc){
opt=document.createElement('option');
opt.label = chip;
opt.value = chip;
chipSel.appendChild(opt);
}
chipSel.addEventListener("change", () => {
handleCB_SOC(chipSel.value);
});
}
function addEvtListFeatureReport(){
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight*10 + "px";
}
});
}
}
window.addEventListener("load", function(event) {
makeChipSelector();
makeSelector();
try{
const button = document.querySelector("esp-web-install-button");
button.overrides = {
checkSameFirmware(manifest, improvInfo) {
const manifestFirmware = manifest.name.toLowerCase();
const deviceFirmware = improvInfo.firmware.toLowerCase();
return manifestFirmware.includes(deviceFirmware);
}
};
console.log(button.shadowRoot.firstChild.name);
if(button.shadowRoot.firstChild.name == 'activate'){
//success: add the select picker and some info
const selectEl = document.querySelector("#pick-variant-selector");
button.manifest = "https://tasmota.github.io/install/manifest_ext/release.tasmota.manifest.json";
selectEl.addEventListener("change", () => {
button.manifest = selectEl.value;
show_features(selectEl.value);
// console.log(button.manifest);
});
}
}
catch(e){
console.log(e);
}
},{ once: true });
function handleCB_SOC(chip) {
if(chip=='All'){
picker_data = backup_data;
}
else{
var picker_data = {};
for(section of Object.entries(backup_data)){
picker_data[section[0]]= [];
for(line of backup_data[section[0]]){
if (line["chipFamilies"].includes(chip)){
picker_data[section[0]].push(line);
}
}
}
}
var sel=document.querySelector("#pick-variant-selector");
sel.innerHTML = '';
make_select(picker_data);
}
</script>
</head>
<body>
<div style='display:inline-block;color:#eaeaea;min-width:340px;'>
<h1>Install Tasmota</h1>
<div class='pick-variant'>
<ol style='text-align:left'>
<li>Connect the ESP device to your computer</br>using USB or serial-to-USB adapter</li></br>
<li>Select the firmware variant suitable for</br>your device</li></br>
<li>Hit "Install" and select the correct port</br>or find help if <a href="https://tasmota.github.io/docs/Getting-Started/" target='_blank' style='color:#aaa;'>no device found</a></li>
</ol>
</br>
</br>
<span>
<select style="width:70%;" id="pick-variant-selector"></select>
<select style="width:25%;" id="selected_chip"></select>
</span>
<p>
</br>
<esp-web-install-button id="inst" style='text-align:center'>
<i slot="unsupported">
Your browser does not support Web Serial.</br>Open this page in Google Chrome or</br>Microsoft Edge instead
<span class="not-supported-i hidden">(but not on your mobile device)</span>.
</i>
</esp-web-install-button>
</p>
<div id='feature_report'>
</div>
</div>
<div style='text-align:right;font-size:11px;'>
<hr/>
<a href="https://esphome.github.io/esp-web-tools/" target='_blank' style='color:#aaa;'>Tasmota Installer powered by ESP Web Tools</a>
</div>
</div>
<script>
const driver_info = {
"Xdrv": {
"1": "webserver",
"2": "mqtt",
"3": "energy",
"4": "light",
"5": "irremote",
"6": "snfbridge",
"7": "domoticz",
"8": "serial",
"9": "timers",
"10": "scripter",
"11": "knx",
"12": "home",
"13": "display",
"14": "mp3",
"15": "pca9685",
"16": "tuyamcu",
"17": "rcswitch",
"18": "armtronix",
"19": "ps16dz",
"20": "hue",
"21": "wemo",
"22": "ifan",
"23": "zigbee",
"24": "buzzer",
"25": "A4988",
"26": "ariluxrf",
"27": "shutter",
"28": "pcf8574",
"29": "deepsleep",
"30": "exs",
"31": "tasmota-client",
"32": "hotplug",
"33": "nrf24l01",
"34": "wemos",
"35": "pwm",
"36": "keeloq",
"37": "d1",
"38": "ping",
"39": "thermostat",
"40": "telegram",
"41": "tcp",
"42": "i2s",
"43": "mlx90640",
"44": "miel",
"45": "shelly",
"46": "ccloader",
"47": "ftc532",
"48": "timeprop",
"49": "pid",
"50": "filesystem",
"51": "bs814a2",
"52": "berry",
"53": "projector",
"54": "lvgl",
"55": "touch",
"56": "rtc",
"57": "tasmesh",
"58": "range-extender",
"59": "influxdb",
"60": "shift595",
"61": "ds3502",
"62": "improv",
"79": "ble",
"81": "webcam",
"82": "ethernet",
"83": "watch",
"85": "ble",
"86": "sonoff",
"98": "file",
"99": "debug"
},
"Xlgt": {
"1": "ws2812",
"2": "my92x1",
"3": "sm16716",
"4": "sm2135",
"5": "l1",
"6": "electriq",
"7": "lsc"
},
"Xdsp": {
"1": "lcd",
"2": "ssd1306",
"3": "matrix",
"4": "ili9341",
"5": "epaper",
"6": "epaper",
"7": "sh1106",
"9": "SSD1351",
"10": "RA8876",
"11": "sevenseg",
"12": "ST7789",
"14": "SSD1331",
"15": "tm1637",
"16": "epaper",
"17": "universal",
"18": "berry",
"19": "max7219"
},
"Xnrg": {
"1": "hlw8012",
"2": "cse7766",
"3": "pzem004t",
"4": "mcp39f501",
"5": "pzem",
"6": "pzem",
"7": "ade7953",
"8": "sdm120",
"9": "dds2382",
"10": "sdm630",
"11": "ddsu666",
"12": "solaxX1",
"13": "fif",
"14": "bl09xx",
"15": "teleinfo",
"16": "iem3000",
"17": "ornowe517",
"18": "sdm72",
"19": "cse7761",
"21": "sdm230",
"22": "bl6523",
"23": "ade7880",
"30": "dummy"
},
"Xsns": {
"1": "counter",
"2": "analog",
"4": "snfsc",
"5": "ds18x20",
"6": "dht",
"7": "sht1x",
"8": "htu21",
"9": "bmp",
"10": "bh1750",
"11": "veml6070",
"12": "ads1115",
"13": "ina219",
"14": "sht3x",
"15": "mhz19",
"16": "tsl2561",
"17": "senseair",
"18": "pms5003",
"19": "mgs",
"20": "novasds",
"21": "sgp30",
"22": "sr04",
"24": "si1145",
"26": "lm75ad",
"27": "apds9960",
"28": "tm1638",
"29": "mcp230xx",
"30": "mpr121",
"31": "ccs811",
"32": "mpu6050",
"34": "hx711",
"35": "tx20",
"36": "mgc3130",
"37": "rfsensor",
"38": "az7798",
"39": "max31855",
"40": "pn532",
"41": "max44009",
"42": "scd30",
"43": "hre",
"44": "sps30",
"45": "vl53l0x",
"46": "MLX90614",
"47": "max31865",
"48": "chirp",
"50": "paj7620",
"51": "rdm6300",
"52": "ibeacon",
"53": "sml",
"54": "ina226",
"55": "hih",
"56": "hpma",
"57": "tsl2591",
"58": "dht12",
"59": "ds1624",
"60": "GPS",
"61": "MI32-NRF24",
"62": "MI32",
"63": "aht1x",
"64": "hrxl",
"65": "hdc1080",
"66": "iAQ",
"67": "as3935",
"68": "windmeter",
"69": "opentherm",
"70": "veml6075",
"71": "veml7700",
"72": "mcp9808",
"73": "hp303b",
"74": "lmt01",
"75": "prometheus",
"76": "dyp",
"77": "vl53l1x",
"78": "ezoph",
"79": "as608",
"80": "mfrc522",
"81": "seesaw",
"82": "wiegand",
"83": "neopool",
"84": "tof10120",
"85": "mpu6886",
"86": "tfminiplus",
"87": "mcp2515",
"88": "am2320",
"89": "t67xx",
"90": "hrg15",
"91": "vindriktning",
"92": "scd40",
"93": "hm330x",
"94": "hdc2010",
"95": "cm110x",
"96": "flowratemeter",
"127": "sensors"
}
};
</script>
</body>
</html>