Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
733 B

  1. /*
  2. ESPurna
  3. DHT MODULE
  4. Copyright (C) 2016 by Xose Pérez <xose dot perez at gmail dot com>
  5. */
  6. #if ENABLE_FAUXMO
  7. #include <fauxmoESP.h>
  8. fauxmoESP fauxmo;
  9. // -----------------------------------------------------------------------------
  10. // FAUXMO
  11. // -----------------------------------------------------------------------------
  12. void fauxmoConfigure() {
  13. fauxmo.enable(getSetting("fauxmoEnabled", String(FAUXMO_ENABLED)).toInt() == 1);
  14. }
  15. void fauxmoSetup() {
  16. fauxmoConfigure();
  17. fauxmo.addDevice(getSetting("hostname", HOSTNAME).c_str());
  18. fauxmo.onMessage([](const char * name, bool state) {
  19. DEBUG_MSG("[FAUXMO] %s state: %s\n", name, state ? "ON" : "OFF");
  20. relayStatus(0, state);
  21. });
  22. }
  23. #endif