Browse Source

Small changes

fastled
Xose Pérez 8 years ago
parent
commit
51f2295cfb
7 changed files with 32 additions and 21 deletions
  1. +0
    -5
      code/html/custom.css
  2. +8
    -8
      code/html/index.html
  3. +0
    -1
      code/main
  4. +4
    -4
      code/src/defaults.h
  5. +18
    -1
      code/src/settings.ino
  6. +1
    -1
      code/src/webserver.ino
  7. +1
    -1
      code/vendor/emonliteesp

+ 0
- 5
code/html/custom.css View File

@ -46,11 +46,6 @@ legend {
.l-box { .l-box {
padding-right: 1px; padding-right: 1px;
} }
#topics .pure-g {
padding-bottom: 5px;
margin-bottom: 5px;
border-bottom: 1px dashed #e5e5e5;
}
.pure-form input[type=text][disabled] { .pure-form input[type=text][disabled] {
color: #777777; color: #777777;
} }


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

@ -79,22 +79,22 @@
<div class="pure-g"> <div class="pure-g">
<label class="pure-u-1 pure-u-sm-1-4" for="manufacturer">Manufacturer</label> <label class="pure-u-1 pure-u-sm-1-4" for="manufacturer">Manufacturer</label>
<input class="pure-u-1 pure-u-sm-3-4" type="text" name="manufacturer" disabled>
<input class="pure-u-1 pure-u-sm-3-4" type="text" name="manufacturer" readonly />
</div> </div>
<div class="pure-g"> <div class="pure-g">
<label class="pure-u-1 pure-u-sm-1-4" for="chipid">Chip ID</label>
<input class="pure-u-1 pure-u-sm-3-4" type="text" name="chipid" disabled>
<label class="pure-u-1 pure-u-sm-1-4" for="device">Device</label>
<input class="pure-u-1 pure-u-sm-3-4" type="text" name="device" readonly />
</div> </div>
<div class="pure-g"> <div class="pure-g">
<label class="pure-u-1 pure-u-sm-1-4" for="mac">MAC</label>
<input class="pure-u-1 pure-u-sm-3-4" type="text" name="mac" disabled>
<label class="pure-u-1 pure-u-sm-1-4" for="chipid">Chip ID</label>
<input class="pure-u-1 pure-u-sm-3-4" type="text" name="chipid" readonly />
</div> </div>
<div class="pure-g"> <div class="pure-g">
<label class="pure-u-1 pure-u-sm-1-4" for="device">Device</label>
<input class="pure-u-1 pure-u-sm-3-4" type="text" name="device" disabled>
<label class="pure-u-1 pure-u-sm-1-4" for="mac">MAC</label>
<input class="pure-u-1 pure-u-sm-3-4" type="text" name="mac" readonly />
</div> </div>
<div class="pure-g"> <div class="pure-g">
@ -144,7 +144,7 @@
<div class="header"> <div class="header">
<h1>GENERAL</h1> <h1>GENERAL</h1>
<h2></h2>
<h2>General configuration values</h2>
</div> </div>
<div class="page"> <div class="page">


+ 0
- 1
code/main View File

@ -1 +0,0 @@
src

+ 4
- 4
code/src/defaults.h View File

@ -71,9 +71,6 @@
#define NOFUSS_SERVER "http://192.168.1.100" #define NOFUSS_SERVER "http://192.168.1.100"
#define NOFUSS_INTERVAL 3600000 #define NOFUSS_INTERVAL 3600000
// 0 means OFF, 1 ON and 2 whatever was before
#define RELAY_MODE 1
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// MQTT // MQTT
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -81,8 +78,8 @@
#define MQTT_SERVER "192.168.1.100" #define MQTT_SERVER "192.168.1.100"
#define MQTT_PORT 1883 #define MQTT_PORT 1883
#define MQTT_TOPIC "/test/switch/{identifier}" #define MQTT_TOPIC "/test/switch/{identifier}"
#define MQTT_RECONNECT_DELAY 10000
#define MQTT_RETAIN true #define MQTT_RETAIN true
#define MQTT_RECONNECT_DELAY 10000
#define MQTT_STATUS_TOPIC "" #define MQTT_STATUS_TOPIC ""
#define MQTT_IP_TOPIC "/ip" #define MQTT_IP_TOPIC "/ip"
#define MQTT_VERSION_TOPIC "/version" #define MQTT_VERSION_TOPIC "/version"
@ -102,6 +99,9 @@
// DRIVERS // DRIVERS
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
// 0 means OFF, 1 ON and 2 whatever was before
#define RELAY_MODE 1
#define RF_PIN 14 #define RF_PIN 14
#define RF_CHANNEL 31 #define RF_CHANNEL 31
#define RF_DEVICE 1 #define RF_DEVICE 1


+ 18
- 1
code/src/settings.ino View File

@ -10,8 +10,9 @@ Copyright (C) 2016 by Xose Pérez <xose dot perez at gmail dot com>
#include "Embedis.h" #include "Embedis.h"
#include <EEPROM.h> #include <EEPROM.h>
#include "spi_flash.h" #include "spi_flash.h"
#include <StreamString.h>
#define AUTO_SAVE 0
#define AUTO_SAVE 1
Embedis embedis(Serial); Embedis embedis(Serial);
@ -20,7 +21,9 @@ Embedis embedis(Serial);
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void settingsSetup() { void settingsSetup() {
EEPROM.begin(SPI_FLASH_SEC_SIZE); EEPROM.begin(SPI_FLASH_SEC_SIZE);
Embedis::dictionary( F("EEPROM"), Embedis::dictionary( F("EEPROM"),
SPI_FLASH_SEC_SIZE, SPI_FLASH_SEC_SIZE,
[](size_t pos) -> char { return EEPROM.read(pos); }, [](size_t pos) -> char { return EEPROM.read(pos); },
@ -31,7 +34,21 @@ void settingsSetup() {
[]() {} []() {}
#endif #endif
); );
Embedis::hardware( F("wifi"), [](Embedis* e) {
StreamString s;
WiFi.printDiag(s);
e->response(s);
}, 0);
Embedis::command( F("reconnect"), [](Embedis* e) {
wifiConfigure();
wifiDisconnect();
e->response(Embedis::OK);
});
DEBUG_MSG("[SETTINGS] Initialized\n"); DEBUG_MSG("[SETTINGS] Initialized\n");
} }
void settingsLoop() { void settingsLoop() {


+ 1
- 1
code/src/webserver.ino View File

@ -134,7 +134,7 @@ void webServerSetup() {
//SPIFFS.begin(); //SPIFFS.begin();
// Relay control
// Routes
server.on("/reconnect", HTTP_GET, handleReconnect); server.on("/reconnect", HTTP_GET, handleReconnect);
server.on("/reset", HTTP_GET, handleReset); server.on("/reset", HTTP_GET, handleReset);
server.on("/relay/on", HTTP_GET, handleRelayOn); server.on("/relay/on", HTTP_GET, handleRelayOn);


+ 1
- 1
code/vendor/emonliteesp

@ -1 +1 @@
Subproject commit 4f700a6a1067ef289e23d20d02902d2485952b66
Subproject commit 84ab031a5e7022183a78e5e69fa84d68007952d0

Loading…
Cancel
Save