Skip to content

Commit

Permalink
Renaming EEHDEVICE to Device
Browse files Browse the repository at this point in the history
Updating short status to make it generic and compatible with
esp32-discord-proxy
  • Loading branch information
smford committed Jul 6, 2020
1 parent 1bf72da commit e9a1d4d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions eeh-esp32-rfid.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// file upload progress based upon https://codepen.io/PerfectIsShit/pen/zogMXP
// wifi scanning based upon https://github.com/me-no-dev/ESPAsyncWebServer#scanning-for-available-wifi-networks

#define FIRMWARE_VERSION "v1.7.8-ota"
#define FIRMWARE_VERSION "v1.7.9-ota"

// configuration structure
struct Config {
Expand Down Expand Up @@ -548,7 +548,7 @@ String getFullStatus() {
fullStatusDoc["Hostname"] = config.hostname;
fullStatusDoc["BootTime"] = bootTime;
fullStatusDoc["AppName"] = config.appname;
fullStatusDoc["EEHDevice"] = config.device;
fullStatusDoc["Device"] = config.device;
fullStatusDoc["OverrideUsers"] = config.overridecodes;
fullStatusDoc["SyslogServer"] = config.syslogserver;
fullStatusDoc["SyslogPort"] = config.syslogport;
Expand Down Expand Up @@ -664,12 +664,13 @@ String getStatus() {
StaticJsonDocument<200> shortStatusDoc;
shortStatusDoc["Timestamp"] = printTime();
shortStatusDoc["Hostname"] = config.hostname;
shortStatusDoc["Device"] = config.device;

// note this is the opposite of what is expected due to the way the relay works
if (digitalRead(config.relaypin)) {
shortStatusDoc[config.device] = "off";
shortStatusDoc["State"] = "off";
} else {
shortStatusDoc[config.device] = "on";
shortStatusDoc["State"] = "on";
}

if (config.inmaintenance) {
Expand Down

0 comments on commit e9a1d4d

Please sign in to comment.