Browse Source

Show proper switches names in web UI

alexa
Xose Pérez 5 years ago
parent
commit
433f089c00
14 changed files with 16191 additions and 16166 deletions
  1. BIN
      code/espurna/data/index.all.html.gz
  2. BIN
      code/espurna/data/index.light.html.gz
  3. BIN
      code/espurna/data/index.rfbridge.html.gz
  4. BIN
      code/espurna/data/index.rfm69.html.gz
  5. BIN
      code/espurna/data/index.sensor.html.gz
  6. BIN
      code/espurna/data/index.small.html.gz
  7. +26
    -1
      code/espurna/relay.ino
  8. +2225
    -2225
      code/espurna/static/index.all.html.gz.h
  9. +2982
    -2982
      code/espurna/static/index.light.html.gz.h
  10. +2585
    -2585
      code/espurna/static/index.rfbridge.html.gz.h
  11. +3186
    -3186
      code/espurna/static/index.rfm69.html.gz.h
  12. +2643
    -2643
      code/espurna/static/index.sensor.html.gz.h
  13. +2543
    -2543
      code/espurna/static/index.small.html.gz.h
  14. +1
    -1
      code/html/index.html

BIN
code/espurna/data/index.all.html.gz View File


BIN
code/espurna/data/index.light.html.gz View File


BIN
code/espurna/data/index.rfbridge.html.gz View File


BIN
code/espurna/data/index.rfm69.html.gz View File


BIN
code/espurna/data/index.sensor.html.gz View File


BIN
code/espurna/data/index.small.html.gz View File


+ 26
- 1
code/espurna/relay.ino View File

@ -609,8 +609,33 @@ void _relayWebSocketOnStart(JsonObject& root) {
// Configuration // Configuration
JsonArray& config = root.createNestedArray("relayConfig"); JsonArray& config = root.createNestedArray("relayConfig");
for (unsigned char i=0; i<relayCount(); i++) { for (unsigned char i=0; i<relayCount(); i++) {
JsonObject& line = config.createNestedObject(); JsonObject& line = config.createNestedObject();
line["gpio"] = _relays[i].pin;
if (GPIO_NONE == _relays[i].pin) {
#if (RELAY_PROVIDER == RELAY_PROVIDER_LIGHT)
if (DUMMY_RELAY_COUNT > i) {
if (DUMMY_RELAY_COUNT == lightChannels()) {
line["gpio"] = String("CH") + String(i);
} else if (DUMMY_RELAY_COUNT == (lightChannels() + 1u)) {
if (0 == i) {
line["gpio"] = String("Light");
} else {
line["gpio"] = String("CH") + String(i-1);
}
} else {
line["gpio"] = String("Light");
}
} else {
line["gpio"] = String("?");
}
#else
line["gpio"] = String("SW") + String(i);
#endif
} else {
line["gpio"] = String("GPIO") + String(_relays[i].pin);
}
line["type"] = _relays[i].type; line["type"] = _relays[i].type;
line["reset"] = _relays[i].reset_pin; line["reset"] = _relays[i].reset_pin;
line["boot"] = getSetting("relayBoot", i, RELAY_BOOT_MODE).toInt(); line["boot"] = getSetting("relayBoot", i, RELAY_BOOT_MODE).toInt();


+ 2225
- 2225
code/espurna/static/index.all.html.gz.h
File diff suppressed because it is too large
View File


+ 2982
- 2982
code/espurna/static/index.light.html.gz.h
File diff suppressed because it is too large
View File


+ 2585
- 2585
code/espurna/static/index.rfbridge.html.gz.h
File diff suppressed because it is too large
View File


+ 3186
- 3186
code/espurna/static/index.rfm69.html.gz.h
File diff suppressed because it is too large
View File


+ 2643
- 2643
code/espurna/static/index.sensor.html.gz.h
File diff suppressed because it is too large
View File


+ 2543
- 2543
code/espurna/static/index.small.html.gz.h
File diff suppressed because it is too large
View File


+ 1
- 1
code/html/index.html View File

@ -1563,7 +1563,7 @@
</div> </div>
<div id="relayConfigTemplate" class="template"> <div id="relayConfigTemplate" class="template">
<legend>Switch #<span class="id"></span> (GPIO<span class="gpio"></span>)</legend>
<legend>Switch #<span class="id"></span> (<span class="gpio"></span>)</legend>
<div class="pure-g"> <div class="pure-g">
<div class="pure-u-1 pure-u-lg-1-4"><label>Boot mode</label></div> <div class="pure-u-1 pure-u-lg-1-4"><label>Boot mode</label></div>
<select class="pure-u-1 pure-u-lg-3-4" name="relayBoot"> <select class="pure-u-1 pure-u-lg-3-4" name="relayBoot">


Loading…
Cancel
Save