Browse Source

Added LED_MODE_STATUS

softuart
Xose Pérez 7 years ago
parent
commit
f60f5d82a2
5 changed files with 3192 additions and 3176 deletions
  1. +1
    -0
      code/espurna/config/general.h
  2. BIN
      code/espurna/data/index.html.gz
  3. +11
    -0
      code/espurna/led.ino
  4. +3178
    -3176
      code/espurna/static/index.html.gz.h
  5. +2
    -0
      code/html/index.html

+ 1
- 0
code/espurna/config/general.h View File

@ -319,6 +319,7 @@ PROGMEM const char* const custom_reset_string[] = {
#define LED_MODE_MIXED 5 // A mixed between WIFI and FINDME
#define LED_MODE_ON 6 // LED always ON
#define LED_MODE_OFF 7 // LED always OFF
#define LED_MODE_STATUS 8 // If any relay is ON, LED will be ON, otherwise OFF
// -----------------------------------------------------------------------------
// WIFI


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


+ 11
- 0
code/espurna/led.ino View File

@ -235,6 +235,17 @@ void ledLoop() {
_ledStatus(i, status);
}
if (_ledMode(i) == LED_MODE_STATUS) {
bool status = false;
for (unsigned char k=0; k<relayCount(); k++) {
if (relayStatus(k)) {
status = true;
break;
}
}
_ledStatus(i, status);
}
if (_ledMode(i) == LED_MODE_ON) {
_ledStatus(i, true);
}


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


+ 2
- 0
code/html/index.html View File

@ -288,6 +288,7 @@
<option value="1">WiFi status</option>
<option value="0">MQTT managed</option>
<option value="4">Find me</option>
<option value="8">Status</option>
<option value="5">Mixed</option>
<option value="6">Always ON</option>
<option value="7">Always OFF</option>
@ -299,6 +300,7 @@
When in "WiFi status" it will blink at 1Hz when trying to connecting. If successfully connected if will briefly lit every 5 seconds if in STA mode or every second if in AP mode.<br />
When in "MQTT managed" mode you will be able to set the LED state sending a message to "&lt;base_topic&gt;/led/0/set" with a payload of 0, 1 or 2 (to toggle it).<br />
When in "Find me" mode the LED will be ON when all relays are OFF. This is meant to locate switches at night.<br />
When in "Status" mode the LED will be ON whenever any relay is ON, and OFF otherwise. This is global status notification.<br />
When in "Mixed" mode it will follow the WiFi status but will stay mostly on when relays are OFF, and mostly OFF when any of them is ON.<br />
"Always ON" and "Always OFF" modes are self-explanatory.
</div>


Loading…
Cancel
Save