Skip to content

Commit

Permalink
Merge branch 'master' into jeremypoulter/issue29
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypoulter committed May 17, 2024
2 parents 5e1167a + 52e074f commit 4f1cee4
Show file tree
Hide file tree
Showing 56 changed files with 5,590 additions and 177 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ jobs:
- olimex_esp32-poe-iso
- heltec_esp32-wifi-lora-v2
- wt32-eth01
- esp32-c3-devkitc-02
- elecrow_esp32_hmi
- elecrow_esp32_hmi_dev
- openevse_wifi_tft_v1
- openevse_wifi_tft_v1_dev
gui:
- name: gui-v2
repo: OpenEVSE/openevse-gui-v2
Expand All @@ -76,21 +81,21 @@ jobs:
submodules: recursive

- name: Cache pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down Expand Up @@ -121,7 +126,7 @@ jobs:
PLATFORMIO_BUILD_FLAGS: ${{ matrix.gui.build_flags }}

- name: Upload output to GitHub
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.env }}.bin
path: .pio/build/${{ matrix.env }}/firmware.bin
Expand All @@ -134,7 +139,7 @@ jobs:

steps:
- name: Download the built assets
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts

Expand All @@ -160,7 +165,7 @@ jobs:
- name: Upload assets to release
if: startsWith(github.ref_name, 'v')
uses: "softprops/action-gh-release@v1"
uses: "softprops/action-gh-release@v2"
with:
prerelease: true
name: "${{ github.ref_name }}"
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PlatformIO Dependabot

on:
workflow_dispatch: # option to manually trigger the workflow
schedule:
# Runs every day at 00:00
- cron: '0 0 * * *'

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
name: run PlatformIO Dependabot
steps:
- name: Checkout
uses: actions/checkout@v4
- name: run PlatformIO Dependabot
uses: peterus/platformio_dependabot@v1
with:
github_token: ${{ secrets.DEPENDABOT_PAT }}
6 changes: 3 additions & 3 deletions .github/workflows/divert_sim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ jobs:
make -j
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: divert_sim
path: OpenEVSE_WiFi/divert_sim/divert_sim

- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
Expand All @@ -96,7 +96,7 @@ jobs:
pytest -v --color=yes --code-highlight yes --junit-xml=output/test_results.xml
- name : Upload test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test_results
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,4 @@ divert_sim/epoxyfsdata
divert_sim/epoxyeepromdata

*.pem
*.pem
Binary file added BootScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ChargeScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions divert_sim/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,53 @@
],
"preLaunchTask": "build",
"miDebuggerPath": "/usr/bin/gdb"
},
{
"name": "divert_sim: config-commit",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/divert_sim",
"args": [
"--config-commit", "--config-check"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build",
"miDebuggerPath": "/usr/bin/gdb"
},
{
"name": "divert_sim: default state setting",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/divert_sim",
"args": [
"--config-commit", "--config-check",
"--config", "{\"default_state\": false}"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
3 changes: 2 additions & 1 deletion divert_sim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ CPPFLAGS := \
-D ARDUINOJSON_ENABLE_PROGMEM=0 \
-D ENABLE_CONFIG_V1_IMPORT=0 \
-D ENABLE_CONFIG_CHANGE_NOTIFICATION=0
# \
# \
# -D ENABLE_DEBUG \
# -D SERIAL_OUTFD=STDERR_FILENO
# -D ENABLE_DEBUG_DIVERT \
# -D ENABLE_DEBUG_INPUT_FILTER \
# -D ENABLE_DEBUG_EVSE_MAN \
Expand Down
23 changes: 21 additions & 2 deletions divert_sim/divert_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ int main(int argc, char** argv)
("c,config", "Config options, either a file name or JSON", cxxopts::value<std::string>(config))
("v,voltage", "The Voltage column if < 50, else the fixed voltage", cxxopts::value<int>(voltage_arg), "N")
("kw", "values are KW")
("sep", "Field separator", cxxopts::value<std::string>(sep));
("sep", "Field separator", cxxopts::value<std::string>(sep))
("config-check", "Output the config and exit")
("config-load", "Simulate loading config from EEPROM")
("config-commit", "Simulate saving the config to EEPROM");

auto result = options.parse(argc, argv);

Expand All @@ -126,7 +129,11 @@ int main(int argc, char** argv)
}

fs::EpoxyFS.begin();
config_reset();
if(result.count("config-load") > 0) {
config_load_settings();
} else {
config_reset();
}

// If config is set and not a JSON string, assume it is a file name
if(config.length() > 0 && config[0] != '{')
Expand All @@ -141,6 +148,18 @@ int main(int argc, char** argv)
config_deserialize(config.c_str());
}

if(result.count("config-commit") > 0) {
config_commit();
}

if(result.count("config-check"))
{
String config_out;
config_serialize(config_out, true, false, false);
std::cout << config_out.c_str() << std::endl;
return EXIT_SUCCESS;
}

kw = result.count("kw") > 0;

divert_type = grid_ie_col >= 0 ? 1 : 0;
Expand Down
Loading

0 comments on commit 4f1cee4

Please sign in to comment.