From 344101a4c1bbc127d8092d29af41dc4a7ea1052b Mon Sep 17 00:00:00 2001 From: fboundy Date: Sun, 22 Dec 2024 18:11:58 +0000 Subject: [PATCH] Updated workflows --- .github/workflows/black-check.yaml | 22 ++++++++++++---------- apps/pv_opt/solis.py | 10 +++++++++- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/black-check.yaml b/.github/workflows/black-check.yaml index a358e4a..53aea88 100644 --- a/.github/workflows/black-check.yaml +++ b/.github/workflows/black-check.yaml @@ -1,21 +1,20 @@ -name: Auto-format with Black +name: Auto-format with Black and isort on: push: branches: - - main # Specify branches to run on (e.g., `main`) + - main - patch - - dev - + - dev # Add additional branches here as needed pull_request: branches: - - main # Automatically format PRs targeting `main` + - main - patch - - dev + - dev # Ensure formatting is applied for PRs targeting these branches jobs: autoformat: - name: Auto-format Code with Black + name: Auto-format Code with Black and isort runs-on: ubuntu-latest steps: @@ -27,10 +26,13 @@ jobs: with: python-version: '3.x' - - name: Install Black + - name: Install Black and isort run: | python -m pip install --upgrade pip - pip install black + pip install black isort + + - name: Run isort + run: isort . - name: Run Black Formatter run: black --line-length 119 . @@ -41,7 +43,7 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" if [ -n "$(git status --porcelain)" ]; then git add . - git commit -m "Automatically formatted code with Black (line-length=119)" + git commit -m "Automatically formatted code with Black and isort" git push else echo "No changes to commit." diff --git a/apps/pv_opt/solis.py b/apps/pv_opt/solis.py index d1ac49e..627e9fb 100644 --- a/apps/pv_opt/solis.py +++ b/apps/pv_opt/solis.py @@ -49,7 +49,15 @@ REGISTERS = { True: { - "timed_charge_soc": 43708, "timed_charge_current": 43709, "timed_charge_start_hours": 43711, "timed_charge_start_minutes": 43712, "timed_charge_end_hours": 43713, "timed_charge_end_minutes": 43714, "timed_discharge_soc": 43750, "timed_discharge_current": 43151, "timed_discharge_start_hours": 43153, + "timed_charge_soc": 43708, + "timed_charge_current": 43709, + "timed_charge_start_hours": 43711, + "timed_charge_start_minutes": 43712, + "timed_charge_end_hours": 43713, + "timed_charge_end_minutes": 43714, + "timed_discharge_soc": 43750, + "timed_discharge_current": 43151, + "timed_discharge_start_hours": 43153, "timed_discharge_start_minutes": 43154, "timed_discharge_end_hours": 43155, "timed_discharge_end_minutes": 43156,