mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
updated comments
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#include <APSettingsService.h>
|
#include <APSettingsService.h>
|
||||||
|
|
||||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
|
||||||
APSettingsService::APSettingsService(AsyncWebServer * server, FS * fs, SecurityManager * securityManager)
|
APSettingsService::APSettingsService(AsyncWebServer * server, FS * fs, SecurityManager * securityManager)
|
||||||
: _httpEndpoint(APSettings::read, APSettings::update, this, server, AP_SETTINGS_SERVICE_PATH, securityManager)
|
: _httpEndpoint(APSettings::read, APSettings::update, this, server, AP_SETTINGS_SERVICE_PATH, securityManager)
|
||||||
|
|||||||
@@ -18,10 +18,7 @@ void FactoryResetService::handleRequest(AsyncWebServerRequest * request) {
|
|||||||
* Delete function assumes that all files are stored flat, within the config directory.
|
* Delete function assumes that all files are stored flat, within the config directory.
|
||||||
*/
|
*/
|
||||||
void FactoryResetService::factoryReset() {
|
void FactoryResetService::factoryReset() {
|
||||||
/*
|
// TODO Could be replaced with fs.rmdir(FS_CONFIG_DIRECTORY) in IDF 4.2
|
||||||
* Based on LittleFS. Modified by proddy
|
|
||||||
* Could be replaced with fs.rmdir(FS_CONFIG_DIRECTORY) in IDF 4.2
|
|
||||||
*/
|
|
||||||
File root = fs->open(FS_CONFIG_DIRECTORY);
|
File root = fs->open(FS_CONFIG_DIRECTORY);
|
||||||
File file;
|
File file;
|
||||||
while (file = root.openNextFile()) {
|
while (file = root.openNextFile()) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include <FeaturesService.h>
|
#include <FeaturesService.h>
|
||||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
|
||||||
using namespace std::placeholders; // for `_1` etc
|
using namespace std::placeholders; // for `_1` etc
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class HttpPostEndpoint {
|
|||||||
response->setLength();
|
response->setLength();
|
||||||
|
|
||||||
if (outcome == StateUpdateResult::CHANGED_RESTART) {
|
if (outcome == StateUpdateResult::CHANGED_RESTART) {
|
||||||
response->setCode(205); // added by proddy, reboot required
|
response->setCode(205); // reboot required
|
||||||
}
|
}
|
||||||
request->send(response);
|
request->send(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include <MqttSettingsService.h>
|
#include <MqttSettingsService.h>
|
||||||
|
|
||||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
|
||||||
using namespace std::placeholders; // for `_1` etc
|
using namespace std::placeholders; // for `_1` etc
|
||||||
|
|
||||||
@@ -144,7 +144,6 @@ void MqttSettingsService::onConfigUpdated() {
|
|||||||
_reconfigureMqtt = true;
|
_reconfigureMqtt = true;
|
||||||
_disconnectedAt = 0;
|
_disconnectedAt = 0;
|
||||||
|
|
||||||
// added by proddy
|
|
||||||
startClient();
|
startClient();
|
||||||
emsesp::EMSESP::mqtt_.start(); // reload EMS-ESP MQTT settings
|
emsesp::EMSESP::mqtt_.start(); // reload EMS-ESP MQTT settings
|
||||||
}
|
}
|
||||||
@@ -231,7 +230,6 @@ void MqttSettings::read(MqttSettings & settings, JsonObject & root) {
|
|||||||
root["clean_session"] = settings.cleanSession;
|
root["clean_session"] = settings.cleanSession;
|
||||||
root["entity_format"] = settings.entity_format;
|
root["entity_format"] = settings.entity_format;
|
||||||
|
|
||||||
// added by proddy for EMS-ESP
|
|
||||||
root["publish_time_boiler"] = settings.publish_time_boiler;
|
root["publish_time_boiler"] = settings.publish_time_boiler;
|
||||||
root["publish_time_thermostat"] = settings.publish_time_thermostat;
|
root["publish_time_thermostat"] = settings.publish_time_thermostat;
|
||||||
root["publish_time_solar"] = settings.publish_time_solar;
|
root["publish_time_solar"] = settings.publish_time_solar;
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class MqttSettings {
|
|||||||
uint16_t keepAlive;
|
uint16_t keepAlive;
|
||||||
bool cleanSession;
|
bool cleanSession;
|
||||||
|
|
||||||
// proddy EMS-ESP specific
|
// EMS-ESP specific
|
||||||
String base;
|
String base;
|
||||||
uint16_t publish_time_boiler;
|
uint16_t publish_time_boiler;
|
||||||
uint16_t publish_time_thermostat;
|
uint16_t publish_time_thermostat;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include <MqttStatus.h>
|
#include <MqttStatus.h>
|
||||||
|
|
||||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
|
||||||
using namespace std::placeholders; // for `_1` etc
|
using namespace std::placeholders; // for `_1` etc
|
||||||
|
|
||||||
@@ -20,9 +20,9 @@ void MqttStatus::mqttStatus(AsyncWebServerRequest * request) {
|
|||||||
root["client_id"] = _mqttSettingsService->getClientId();
|
root["client_id"] = _mqttSettingsService->getClientId();
|
||||||
root["disconnect_reason"] = (uint8_t)_mqttSettingsService->getDisconnectReason();
|
root["disconnect_reason"] = (uint8_t)_mqttSettingsService->getDisconnectReason();
|
||||||
|
|
||||||
root["mqtt_queued"] = emsesp::Mqtt::publish_queued(); // mdvp added
|
root["mqtt_queued"] = emsesp::Mqtt::publish_queued();
|
||||||
root["mqtt_fails"] = emsesp::Mqtt::publish_fails(); // proddy added
|
root["mqtt_fails"] = emsesp::Mqtt::publish_fails();
|
||||||
root["connect_count"] = emsesp::Mqtt::connect_count(); // mdvp added
|
root["connect_count"] = emsesp::Mqtt::connect_count();
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include <NTPSettingsService.h>
|
#include <NTPSettingsService.h>
|
||||||
#include <esp_sntp.h>
|
#include <esp_sntp.h>
|
||||||
|
|
||||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
|
||||||
using namespace std::placeholders; // for `_1` etc
|
using namespace std::placeholders; // for `_1` etc
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include <NTPStatus.h>
|
#include <NTPStatus.h>
|
||||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
|
||||||
using namespace std::placeholders; // for `_1` etc
|
using namespace std::placeholders; // for `_1` etc
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include <NetworkStatus.h>
|
#include <NetworkStatus.h>
|
||||||
|
|
||||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
|
||||||
using namespace std::placeholders; // for `_1` etc
|
using namespace std::placeholders; // for `_1` etc
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include <OTASettingsService.h>
|
#include <OTASettingsService.h>
|
||||||
|
|
||||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
|
||||||
using namespace std::placeholders; // for `_1` etc
|
using namespace std::placeholders; // for `_1` etc
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#if FT_ENABLED(FT_SECURITY)
|
#if FT_ENABLED(FT_SECURITY)
|
||||||
|
|
||||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
|
||||||
SecuritySettingsService::SecuritySettingsService(AsyncWebServer * server, FS * fs)
|
SecuritySettingsService::SecuritySettingsService(AsyncWebServer * server, FS * fs)
|
||||||
: _httpEndpoint(SecuritySettings::read, SecuritySettings::update, this, server, SECURITY_SETTINGS_PATH, this)
|
: _httpEndpoint(SecuritySettings::read, SecuritySettings::update, this, server, SECURITY_SETTINGS_PATH, this)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
enum class StateUpdateResult {
|
enum class StateUpdateResult {
|
||||||
CHANGED = 0, // The update changed the state and propagation should take place if required
|
CHANGED = 0, // The update changed the state and propagation should take place if required
|
||||||
CHANGED_RESTART, // a restart of the device is needed - added by proddy
|
CHANGED_RESTART, // a restart of the device is needed
|
||||||
UNCHANGED, // The state was unchanged, propagation should not take place
|
UNCHANGED, // The state was unchanged, propagation should not take place
|
||||||
ERROR // There was a problem updating the state, propagation should not take place
|
ERROR // There was a problem updating the state, propagation should not take place
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include <SystemStatus.h>
|
#include <SystemStatus.h>
|
||||||
#include <esp_ota_ops.h>
|
#include <esp_ota_ops.h>
|
||||||
|
|
||||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
#include "../../src/emsesp_stub.hpp"
|
||||||
|
|
||||||
using namespace std::placeholders; // for `_1` etc
|
using namespace std::placeholders; // for `_1` etc
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user