|
|
@ -34,7 +34,6 @@ typedef struct
|
|
|
|
|
|
|
|
|
|
|
|
struct deviceConfig
|
|
|
|
struct deviceConfig
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const String firmware{"1.21"};
|
|
|
|
|
|
|
|
String espnowNetName{"DEFAULT"};
|
|
|
|
String espnowNetName{"DEFAULT"};
|
|
|
|
String deviceName = "ESP-NOW light " + String(ESP.getChipId(), HEX);
|
|
|
|
String deviceName = "ESP-NOW light " + String(ESP.getChipId(), HEX);
|
|
|
|
uint8_t ledType{ENLT_NONE};
|
|
|
|
uint8_t ledType{ENLT_NONE};
|
|
|
@ -47,6 +46,8 @@ struct deviceConfig
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<espnow_message_t> espnowMessage;
|
|
|
|
std::vector<espnow_message_t> espnowMessage;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const String firmware{"1.21"};
|
|
|
|
|
|
|
|
|
|
|
|
bool ledStatus{false};
|
|
|
|
bool ledStatus{false};
|
|
|
|
uint8_t brightness{255};
|
|
|
|
uint8_t brightness{255};
|
|
|
|
uint16_t temperature{255};
|
|
|
|
uint16_t temperature{255};
|
|
|
@ -311,7 +312,7 @@ void setupWebServer()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
String configJson;
|
|
|
|
String configJson;
|
|
|
|
DynamicJsonDocument json(384); // To calculate the buffer size uses https://arduinojson.org/v6/assistant.
|
|
|
|
DynamicJsonDocument json(384); // To calculate the buffer size uses https://arduinojson.org/v6/assistant.
|
|
|
|
json["firmware"] = config.firmware;
|
|
|
|
json["firmware"] = firmware;
|
|
|
|
json["espnowNetName"] = config.espnowNetName;
|
|
|
|
json["espnowNetName"] = config.espnowNetName;
|
|
|
|
json["deviceName"] = config.deviceName;
|
|
|
|
json["deviceName"] = config.deviceName;
|
|
|
|
json["ledType"] = config.ledType;
|
|
|
|
json["ledType"] = config.ledType;
|
|
|
@ -349,7 +350,7 @@ void sendAttributesMessage()
|
|
|
|
json["Type"] = "ESP-NOW light";
|
|
|
|
json["Type"] = "ESP-NOW light";
|
|
|
|
json["MCU"] = "ESP8266";
|
|
|
|
json["MCU"] = "ESP8266";
|
|
|
|
json["MAC"] = myNet.getNodeMac();
|
|
|
|
json["MAC"] = myNet.getNodeMac();
|
|
|
|
json["Firmware"] = config.firmware;
|
|
|
|
json["Firmware"] = firmware;
|
|
|
|
json["Library"] = myNet.getFirmwareVersion();
|
|
|
|
json["Library"] = myNet.getFirmwareVersion();
|
|
|
|
json["Uptime"] = "Days:" + String(days) + " Hours:" + String(hours - (days * 24)) + " Mins:" + String(mins - (hours * 60));
|
|
|
|
json["Uptime"] = "Days:" + String(days) + " Hours:" + String(hours - (days * 24)) + " Mins:" + String(mins - (hours * 60));
|
|
|
|
serializeJsonPretty(json, outgoingData.message);
|
|
|
|
serializeJsonPretty(json, outgoingData.message);
|
|
|
|