-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDeclarations.h
61 lines (45 loc) · 2.14 KB
/
Declarations.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Here you can set all variable depending on your requirement and configuration
*/
//////////////////////////////////// json ////////////////////////////////////
#include <ArduinoJson.h>
//////////////////////////////////// wifi ////////////////////////////////////
#include <ESP8266WiFi.h>
WiFiMode_t wifiMode = WIFI_STA; // or WIFI_AP
const char* sta_ssid = "***********"; // KEEP SECRET !
const char* sta_password = "***********"; // KEEP SECRET !
const char* sta_hostname = "AlarmEsp";
const char* ap_ssid = "AP_" + ESP.getChipId();
const char* ap_password = "ESP_0123456789"; // KEEP SECRET !
uint32_t connectionTimeoutWifiSTA = 10000; // WiFi connect timeout per STA in ms. Increase when connecting takes longer. = WIFI_CONNECT_TIMEOUT_MS 5000
//////////////////////////////////// UDP ////////////////////////////////////
#include <ESPAsyncUDP.h>
IPAddress gatewayIP(192,168,1,10); // TO CUSTOM
unsigned int gatewayPort = 9898; // port to send on
IPAddress multicastIP(224,0,0,50);
unsigned int multicastPort = 9898; // port to listen on
// read only
AsyncUDP udpMulticast;
AsyncUDP udpGateway;
String gateway_sid = "";
String gateway_last_token = "";
//////////////////////////////////// Xiaomi gateway ////////////////////////////////////
#include <stdlib.h>
#include "XiaomiGatewayUtils.h"
// This key is the same as gateway key which is setted in MI-Home App by user.
String gateway_password = "**************"; // KEEP SECRET !
bool toggleGatewayLight = true;
bool gateway_lightOn = true;
uint32_t gateway_lightToggleDelay = 5000;
String gateway_lightColor = "0100ff00"; // aarrggbb
bool useGatewayAlarm = true;
bool gateway_isRinging = false;
bool gateway_alarmRing1time = true;
uint32_t gateway_alarmDuration = 5000; // 5s
uint32_t gateway_alarmLightToggleDelay = 500;
Sound gateway_alarmSound = Sound::Bark;
int gateway_alarmSoundVol = 5; // in percentage
String gateway_alarmLightColor = "ffff0000"; // aarrggbb
// read only
uint32_t gateway_lightTogglePreviousTime = 0;
uint32_t gateway_alarmPreviousTime = 0;