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

/*
ESPurna
DHT MODULE
Copyright (C) 2016 by Xose Pérez <xose dot perez at gmail dot com>
*/
#if ENABLE_FAUXMO
#include <fauxmoESP.h>
fauxmoESP fauxmo;
// -----------------------------------------------------------------------------
// FAUXMO
// -----------------------------------------------------------------------------
void fauxmoConfigure() {
fauxmo.enable(getSetting("fauxmoEnabled", String(FAUXMO_ENABLED)).toInt() == 1);
}
void fauxmoSetup() {
fauxmoConfigure();
fauxmo.addDevice(getSetting("hostname", HOSTNAME).c_str());
fauxmo.onMessage([](const char * name, bool state) {
DEBUG_MSG("[FAUXMO] %s state: %s\n", name, state ? "ON" : "OFF");
relayStatus(0, state);
});
}
#endif