Skip to content

Commit

Permalink
Merge branch 'development' into feature/zendure_solarflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vaterlangen committed Sep 25, 2024
2 parents d65be30 + 2265992 commit e51b641
Show file tree
Hide file tree
Showing 66 changed files with 976 additions and 599 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
environments: ${{ steps.envs.outputs.environments }}

build:
name: Build Enviornments
name: Build Environments
runs-on: ubuntu-latest
needs: get_default_envs
strategy:
Expand Down Expand Up @@ -93,18 +93,27 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade platformio setuptools
- name: Enable Corepack
run: |
cd webapp
corepack enable
- name: Setup Node.js and yarn
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "22"
cache: "yarn"
cache-dependency-path: "webapp/yarn.lock"

- name: Install WebApp dependencies
run: yarn --cwd webapp install --frozen-lockfile
run: |
cd webapp
yarn install --frozen-lockfile
- name: Build WebApp
run: yarn --cwd webapp build
run: |
cd webapp
yarn build
- name: Build firmware
run: pio run -e ${{ matrix.environment }}
Expand All @@ -130,7 +139,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/2')
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get tags
run: git fetch --force --tags origin
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/config/release-notes-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"fix"
]
},
{
"title": "## 🌎 Web Application",
"labels": [
"webapp"
]
},
{
"title": "## 📚 Documentation",
"labels": [
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cpplint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ jobs:
build:
runs-on: ubuntu-latest

# prevent push event from triggering if it's part of a PR
if: github.event_name != 'push' || github.event.pull_request == null

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down
103 changes: 0 additions & 103 deletions .github/workflows/test_build.yml

This file was deleted.

19 changes: 14 additions & 5 deletions .github/workflows/yarnlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ jobs:
build:
runs-on: ubuntu-latest

# prevent push event from triggering if it's part of a PR
if: github.event_name != 'push' || github.event.pull_request == null

defaults:
run:
working-directory: webapp

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js and yarn
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "22"
cache: "yarn"
cache-dependency-path: "webapp/yarn.lock"

- name: Install WebApp dependencies
run: yarn --cwd webapp install --frozen-lockfile
run: yarn install --frozen-lockfile

- name: Linting
run: yarn --cwd webapp lint
run: yarn lint
31 changes: 31 additions & 0 deletions .github/workflows/yarnprettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Yarn Prettier

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

# prevent push event from triggering if it's part of a PR
if: github.event_name != 'push' || github.event.pull_request == null

defaults:
run:
working-directory: webapp

steps:
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js and yarn
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "yarn"
cache-dependency-path: "webapp/yarn.lock"

- name: Install WebApp dependencies
run: yarn install --frozen-lockfile

- name: Check Formatting
run: yarn prettier --check src/
24 changes: 24 additions & 0 deletions docs/DeviceProfiles/opendtu_fusion.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,18 @@
"en": 38,
"cs": 37
},
"cmt": {
"clk": -1,
"cs": -1,
"fcs": -1,
"sdio": -1,
"gpio2": -1,
"gpio3": -1
},
"led": {
"led0": 17,
"led1": 18
},
"w5500": {
"sclk": 39,
"mosi": 40,
Expand All @@ -208,6 +220,14 @@
},
{
"name": "OpenDTU Fusion v2 with CMT2300A and W5500 ethernet",
"nrf24": {
"miso": -1,
"mosi": -1,
"clk": -1,
"irq": -1,
"en": -1,
"cs": -1
},
"cmt": {
"clk": 6,
"cs": 4,
Expand All @@ -216,6 +236,10 @@
"gpio2": 3,
"gpio3": 8
},
"led": {
"led0": 17,
"led1": 18
},
"w5500": {
"sclk": 39,
"mosi": 40,
Expand Down
4 changes: 2 additions & 2 deletions include/NetworkSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class NetworkSettingsClass {
void setStaticIp();
void handleMDNS();
void setupMode();
void NetworkEvent(const WiFiEvent_t event);
void NetworkEvent(const WiFiEvent_t event, WiFiEventInfo_t info);

Task _loopTask;

Expand All @@ -86,4 +86,4 @@ class NetworkSettingsClass {
bool _spiEth = false;
};

extern NetworkSettingsClass NetworkSettings;
extern NetworkSettingsClass NetworkSettings;
2 changes: 2 additions & 0 deletions include/PinMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ struct PinMapping_t {
int8_t powermeter_rx;
int8_t powermeter_tx;
int8_t powermeter_dere;
int8_t powermeter_rxen;
int8_t powermeter_txen;
};

class PinMappingClass {
Expand Down
18 changes: 18 additions & 0 deletions include/RestartHelper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once

#include <TaskSchedulerDeclarations.h>

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

private:
void loop();

Task _rebootTask;
};

extern RestartHelperClass RestartHelper;
1 change: 0 additions & 1 deletion include/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class Utils {
static uint32_t getChipId();
static uint64_t generateDtuSerial();
static int getTimezoneOffset();
static void restartDtu();
static bool checkJsonAlloc(const JsonDocument& doc, const char* function, const uint16_t line);
static void removeAllFiles();

Expand Down
4 changes: 4 additions & 0 deletions lib/Hoymiles/src/Hoymiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
#include "Hoymiles.h"
#include "Utils.h"
#include "inverters/HERF_1CH.h"
#include "inverters/HERF_2CH.h"
#include "inverters/HERF_4CH.h"
#include "inverters/HMS_1CH.h"
Expand Down Expand Up @@ -144,6 +145,7 @@ void HoymilesClass::loop()
if (inv->getClearEventlogOnMidnight()) {
inv->EventLog()->clearBuffer();
}
inv->resetRadioStats();
}

lastWeekDay = currentWeekDay;
Expand Down Expand Up @@ -173,6 +175,8 @@ std::shared_ptr<InverterAbstract> HoymilesClass::addInverter(const char* name, c
i = std::make_shared<HM_2CH>(_radioNrf.get(), serial);
} else if (HM_1CH::isValidSerial(serial)) {
i = std::make_shared<HM_1CH>(_radioNrf.get(), serial);
} else if (HERF_1CH::isValidSerial(serial)) {
i = std::make_shared<HERF_1CH>(_radioNrf.get(), serial);
} else if (HERF_2CH::isValidSerial(serial)) {
i = std::make_shared<HERF_2CH>(_radioNrf.get(), serial);
} else if (HERF_4CH::isValidSerial(serial)) {
Expand Down
Loading

0 comments on commit e51b641

Please sign in to comment.