Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Jan 26, 2024
2 parents f709bb7 + 1916d6d commit db51680
Show file tree
Hide file tree
Showing 107 changed files with 1,170 additions and 1,273 deletions.
47 changes: 47 additions & 0 deletions docs/DeviceProfiles/olimex_esp32_gateway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"name": "Olimex ESP32-Gateway",
"nrf24": {
"miso": 14,
"mosi": 13,
"clk": 12,
"irq": 15,
"en": 2,
"cs": 4
},
"eth": {
"enabled": true,
"phy_addr": 0,
"power": 12,
"mdc": 23,
"mdio": 18,
"type": 0,
"clk_mode": 3
}
},
{
"name": "Olimex ESP32-Gateway with SSH1106",
"nrf24": {
"miso": 14,
"mosi": 13,
"clk": 12,
"irq": 15,
"en": 2,
"cs": 4
},
"eth": {
"enabled": true,
"phy_addr": 0,
"power": 12,
"mdc": 23,
"mdio": 18,
"type": 0,
"clk_mode": 3
},
"display": {
"type": 3,
"data": 32,
"clk": 16
}
}
]
3 changes: 2 additions & 1 deletion include/Datastore.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class DatastoreClass {
public:
DatastoreClass();
void init(Scheduler& scheduler);

// Sum of yield total of all enabled inverters, a inverter which is just disabled at night is also included
Expand Down Expand Up @@ -81,4 +82,4 @@ class DatastoreClass {
bool _isAtLeastOnePollEnabled = false;
};

extern DatastoreClass Datastore;
extern DatastoreClass Datastore;
1 change: 1 addition & 0 deletions include/InverterSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

class InverterSettingsClass {
public:
InverterSettingsClass();
void init(Scheduler& scheduler);

private:
Expand Down
3 changes: 2 additions & 1 deletion include/MessageOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

class MessageOutputClass : public Print {
public:
MessageOutputClass();
void init(Scheduler& scheduler);
size_t write(uint8_t c) override;
size_t write(const uint8_t* buffer, size_t size) override;
Expand All @@ -37,4 +38,4 @@ class MessageOutputClass : public Print {
void serialWrite(message_t const& m);
};

extern MessageOutputClass MessageOutput;
extern MessageOutputClass MessageOutput;
3 changes: 2 additions & 1 deletion include/MqttHandleDtu.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class MqttHandleDtuClass {
public:
MqttHandleDtuClass();
void init(Scheduler& scheduler);

private:
Expand All @@ -14,4 +15,4 @@ class MqttHandleDtuClass {
Task _loopTask;
};

extern MqttHandleDtuClass MqttHandleDtu;
extern MqttHandleDtuClass MqttHandleDtu;
3 changes: 2 additions & 1 deletion include/MqttHandleHass.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const byteAssign_fieldDeviceClass_t deviceFieldAssignment[] = {

class MqttHandleHassClass {
public:
MqttHandleHassClass();
void init(Scheduler& scheduler);
void publishConfig();
void forceUpdate();
Expand Down Expand Up @@ -79,4 +80,4 @@ class MqttHandleHassClass {
bool _updateForced = false;
};

extern MqttHandleHassClass MqttHandleHass;
extern MqttHandleHassClass MqttHandleHass;
3 changes: 2 additions & 1 deletion include/MqttHandleInverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

class MqttHandleInverterClass {
public:
MqttHandleInverterClass();
void init(Scheduler& scheduler);

static String getTopic(std::shared_ptr<InverterAbstract> inv, const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId);
Expand Down Expand Up @@ -39,4 +40,4 @@ class MqttHandleInverterClass {
};
};

extern MqttHandleInverterClass MqttHandleInverter;
extern MqttHandleInverterClass MqttHandleInverter;
3 changes: 2 additions & 1 deletion include/MqttHandleInverterTotal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

class MqttHandleInverterTotalClass {
public:
MqttHandleInverterTotalClass();
void init(Scheduler& scheduler);

private:
Expand All @@ -13,4 +14,4 @@ class MqttHandleInverterTotalClass {
Task _loopTask;
};

extern MqttHandleInverterTotalClass MqttHandleInverterTotal;
extern MqttHandleInverterTotalClass MqttHandleInverterTotal;
6 changes: 1 addition & 5 deletions include/WebApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ class WebApiClass {
static void writeConfig(JsonVariant& retMsg, const WebApiError code = WebApiError::GenericSuccess, const String& message = "Settings saved!");

private:
void loop();

Task _loopTask;

AsyncWebServer _server;

WebApiBatteryClass _webApiBattery;
Expand Down Expand Up @@ -82,4 +78,4 @@ class WebApiClass {
WebApiWsBatteryLiveClass _webApiWsBatteryLive;
};

extern WebApiClass WebApi;
extern WebApiClass WebApi;
4 changes: 2 additions & 2 deletions include/WebApi_Huawei.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>
#include <AsyncJson.h>

class WebApiHuaweiClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);
void getJsonData(JsonVariant& root);
private:
void onStatus(AsyncWebServerRequest* request);
Expand Down
5 changes: 2 additions & 3 deletions include/WebApi_battery.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
#pragma once

#include <ESPAsyncWebServer.h>

#include <TaskSchedulerDeclarations.h>

class WebApiBatteryClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onStatus(AsyncWebServerRequest* request);
Expand Down
6 changes: 3 additions & 3 deletions include/WebApi_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>

class WebApiConfigClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onConfigGet(AsyncWebServerRequest* request);
Expand All @@ -16,4 +16,4 @@ class WebApiConfigClass {
void onConfigUpload(AsyncWebServerRequest* request, String filename, size_t index, uint8_t* data, size_t len, bool final);

AsyncWebServer* _server;
};
};
6 changes: 3 additions & 3 deletions include/WebApi_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>

class WebApiDeviceClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onDeviceAdminGet(AsyncWebServerRequest* request);
void onDeviceAdminPost(AsyncWebServerRequest* request);

AsyncWebServer* _server;
};
};
6 changes: 3 additions & 3 deletions include/WebApi_devinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>

class WebApiDevInfoClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onDevInfoStatus(AsyncWebServerRequest* request);

AsyncWebServer* _server;
};
};
9 changes: 6 additions & 3 deletions include/WebApi_dtu.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>

class WebApiDtuClass {
public:
void init(AsyncWebServer& server);
void loop();
WebApiDtuClass();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onDtuAdminGet(AsyncWebServerRequest* request);
void onDtuAdminPost(AsyncWebServerRequest* request);

AsyncWebServer* _server;
bool _performReload = false;

Task _applyDataTask;
void applyDataTaskCb();
};
6 changes: 3 additions & 3 deletions include/WebApi_eventlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>

class WebApiEventlogClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onEventlogStatus(AsyncWebServerRequest* request);

AsyncWebServer* _server;
};
};
6 changes: 3 additions & 3 deletions include/WebApi_firmware.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>

class WebApiFirmwareClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onFirmwareUpdateFinish(AsyncWebServerRequest* request);
void onFirmwareUpdateUpload(AsyncWebServerRequest* request, String filename, size_t index, uint8_t* data, size_t len, bool final);

AsyncWebServer* _server;
};
};
6 changes: 3 additions & 3 deletions include/WebApi_gridprofile.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>

class WebApiGridProfileClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onGridProfileStatus(AsyncWebServerRequest* request);
void onGridProfileRawdata(AsyncWebServerRequest* request);

AsyncWebServer* _server;
};
};
6 changes: 3 additions & 3 deletions include/WebApi_inverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>

class WebApiInverterClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onInverterList(AsyncWebServerRequest* request);
Expand All @@ -16,4 +16,4 @@ class WebApiInverterClass {
void onInverterOrder(AsyncWebServerRequest* request);

AsyncWebServer* _server;
};
};
6 changes: 3 additions & 3 deletions include/WebApi_limit.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>

class WebApiLimitClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onLimitStatus(AsyncWebServerRequest* request);
void onLimitPost(AsyncWebServerRequest* request);

AsyncWebServer* _server;
};
};
6 changes: 3 additions & 3 deletions include/WebApi_maintenance.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#pragma once

#include <ESPAsyncWebServer.h>
#include <TaskSchedulerDeclarations.h>

class WebApiMaintenanceClass {
public:
void init(AsyncWebServer& server);
void loop();
void init(AsyncWebServer& server, Scheduler& scheduler);

private:
void onRebootPost(AsyncWebServerRequest* request);

AsyncWebServer* _server;
};
};
Loading

0 comments on commit db51680

Please sign in to comment.