Browse Source

Upgrade fauxmoESP to v2.0.0 and enable it by default on all builds

fastled
Xose Pérez 7 years ago
parent
commit
f6e3e400c3
5 changed files with 21 additions and 16 deletions
  1. +1
    -1
      code/espurna/config/general.h
  2. +5
    -1
      code/espurna/config/hardware.h
  3. +3
    -0
      code/espurna/espurna.ino
  4. +6
    -7
      code/espurna/fauxmo.ino
  5. +6
    -7
      code/platformio.ini

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

@ -106,4 +106,4 @@
// FAUXO // FAUXO
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#define FAUXMO_ENABLED 0
#define FAUXMO_ENABLED 1

+ 5
- 1
code/espurna/config/hardware.h View File

@ -22,9 +22,13 @@
//#define ENABLE_EMON 1 //#define ENABLE_EMON 1
//#define ENABLE_HLW8018 1 //#define ENABLE_HLW8018 1
//#define ENABLE_RF 1 //#define ENABLE_RF 1
//#define ENABLE_FAUXMO 1
//#define ENABLE_FAUXMO 0
//#define ENABLE_NOFUSS 1 //#define ENABLE_NOFUSS 1
#ifndef ENABLE_FAUXMO
#define ENABLE_FAUXMO 1
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Development boards // Development boards
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------


+ 3
- 0
code/espurna/espurna.ino View File

@ -150,6 +150,9 @@ void loop() {
mqttLoop(); mqttLoop();
ntpLoop(); ntpLoop();
#if ENABLE_FAUXMO
fauxmoLoop();
#endif
#ifndef SONOFF_DUAL #ifndef SONOFF_DUAL
settingsLoop(); settingsLoop();
#endif #endif


+ 6
- 7
code/espurna/fauxmo.ino View File

@ -32,15 +32,14 @@ void fauxmoSetup() {
fauxmo.addDevice((hostname + "_" + i).c_str()); fauxmo.addDevice((hostname + "_" + i).c_str());
} }
} }
fauxmo.onMessage([relays](const char * name, bool state) {
fauxmo.onMessage([relays](unsigned char device_id, const char * name, bool state) {
DEBUG_MSG("[FAUXMO] %s state: %s\n", name, state ? "ON" : "OFF"); DEBUG_MSG("[FAUXMO] %s state: %s\n", name, state ? "ON" : "OFF");
unsigned int id = 0;
if (relays > 1) {
id = name[strlen(name)-1] - '0';
if (id >= relays) id = 0;
}
relayStatus(id, state);
relayStatus(device_id, state);
}); });
} }
void fauxmoLoop() {
fauxmo.handle();
}
#endif #endif

+ 6
- 7
code/platformio.ini View File

@ -12,19 +12,18 @@ lib_deps =
ESPAsyncTCP ESPAsyncTCP
ESPAsyncWebServer ESPAsyncWebServer
https://github.com/marvinroger/async-mqtt-client https://github.com/marvinroger/async-mqtt-client
ESPAsyncUDP
Embedis Embedis
NtpClientLib NtpClientLib
OneWire OneWire
DallasTemperature DallasTemperature
JustWifi JustWifi
HLW8012 HLW8012
FauxmoESP
https://bitbucket.org/xoseperez/fauxmoesp.git
https://bitbucket.org/xoseperez/nofuss.git https://bitbucket.org/xoseperez/nofuss.git
https://bitbucket.org/xoseperez/emonliteesp.git https://bitbucket.org/xoseperez/emonliteesp.git
https://bitbucket.org/xoseperez/debounceevent.git https://bitbucket.org/xoseperez/debounceevent.git
https://github.com/xoseperez/RemoteSwitch-arduino-library.git https://github.com/xoseperez/RemoteSwitch-arduino-library.git
lib_ignore = FauxmoESP, ESPAsyncUDP
lib_ignore =
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -35,7 +34,7 @@ board = d1_mini
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
extra_script = pio_hooks.py extra_script = pio_hooks.py
build_flags = -g -DD1_RELAYSHIELD -DDEBUG_PORT=Serial -DNOWSAUTH
build_flags = -g -DD1_RELAYSHIELD -DDEBUG_PORT=Serial -DDEBUG_FAUXMO=Serial -DNOWSAUTH
[env:d1-debug-ota] [env:d1-debug-ota]
platform = espressif8266 platform = espressif8266
@ -44,7 +43,7 @@ board = d1_mini
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
extra_script = pio_hooks.py extra_script = pio_hooks.py
build_flags = -g -DD1_RELAYSHIELD -DDEBUG_PORT=Serial -DNOWSAUTH
build_flags = -g -DD1_RELAYSHIELD -DDEBUG_PORT=Serial -DDEBUG_FAUXMO=Serial -DNOWSAUTH
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
@ -56,7 +55,7 @@ board = nodemcuv2
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
extra_script = pio_hooks.py extra_script = pio_hooks.py
build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial -DNOWSAUTH
build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial -DDEBUG_FAUXMO=Serial -DNOWSAUTH
[env:node-debug-ota] [env:node-debug-ota]
platform = espressif8266 platform = espressif8266
@ -65,7 +64,7 @@ board = nodemcuv2
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
extra_script = pio_hooks.py extra_script = pio_hooks.py
build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial -DNOWSAUTH
build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial -DDEBUG_FAUXMO=Serial -DNOWSAUTH
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266


Loading…
Cancel
Save