2016-12-13 23:47:54 +01:00
|
|
|
/*
|
|
|
|
* Sonoff
|
|
|
|
* off-the-shelf wifi relay module
|
|
|
|
*
|
|
|
|
* Settings in IDE:
|
|
|
|
* - Board: "Generic ESP8266 Module"
|
|
|
|
* - Flash Size: "1M (64k SPIFFS)"
|
|
|
|
* - Upload Speed: "1152200"
|
|
|
|
*/
|
|
|
|
|
2016-12-14 23:14:17 +01:00
|
|
|
#include "DeviceRelay.h"
|
2016-12-13 23:47:54 +01:00
|
|
|
|
|
|
|
const char* FWNAME = "things@Sonoff";
|
|
|
|
|
|
|
|
const byte PIN_BUTTON = 0;
|
|
|
|
|
2016-12-14 23:14:17 +01:00
|
|
|
const byte PIN_RELAY = 12;
|
|
|
|
DeviceRelay deviceRelay(PIN_RELAY, "relay");
|
|
|
|
|
2016-12-13 23:47:54 +01:00
|
|
|
Device* devices[] = {
|
2016-12-14 23:14:17 +01:00
|
|
|
&deviceRelay,
|
2016-12-13 23:47:54 +01:00
|
|
|
};
|
|
|
|
|
2016-12-14 23:14:17 +01:00
|
|
|
void hardwareSetup() {
|
2016-12-17 21:33:50 +01:00
|
|
|
Homie.setLedPin(13, HIGH);
|
2016-12-14 23:14:17 +01:00
|
|
|
pinMode(PIN_RELAY, OUTPUT);
|
|
|
|
digitalWrite(PIN_RELAY, HIGH);
|
|
|
|
};
|
2016-12-23 00:03:36 +01:00
|
|
|
|
|
|
|
void hardwareLoop() {};
|