From dab6c6e34d40e18a0a5b94a3f9a483f05265cfa1 Mon Sep 17 00:00:00 2001 From: bullitt168 Date: Sun, 27 Aug 2023 08:03:25 +0200 Subject: [PATCH 1/8] Create validate.yaml --- .github/workflows/validate.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/validate.yaml diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 0000000..a1e5883 --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,28 @@ +name: Run validation + +on: [push, pull_request] + +jobs: + validate: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install black flake8 flake8-docstrings isort + - name: Run flake8 + run: flake8 + - name: Run isort + run: isort ./ --check + - name: Run black + run: black ./ --check + - name: Run test install + run: pip install . From 6e7dff5e4fd2e1690814c3ffc8b9236289890e48 Mon Sep 17 00:00:00 2001 From: bullitt168 Date: Sun, 27 Aug 2023 08:07:58 +0200 Subject: [PATCH 2/8] Delete validate.yaml --- .github/workflows/validate.yaml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/workflows/validate.yaml diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml deleted file mode 100644 index a1e5883..0000000 --- a/.github/workflows/validate.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Run validation - -on: [push, pull_request] - -jobs: - validate: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install black flake8 flake8-docstrings isort - - name: Run flake8 - run: flake8 - - name: Run isort - run: isort ./ --check - - name: Run black - run: black ./ --check - - name: Run test install - run: pip install . From e99f38deba98882af9448a5686009f6de93d0e54 Mon Sep 17 00:00:00 2001 From: bullitt168 Date: Sun, 27 Aug 2023 08:11:09 +0200 Subject: [PATCH 3/8] Revert "Delete validate.yaml" This reverts commit 6e7dff5e4fd2e1690814c3ffc8b9236289890e48. --- .github/workflows/validate.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/validate.yaml diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 0000000..a1e5883 --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,28 @@ +name: Run validation + +on: [push, pull_request] + +jobs: + validate: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install black flake8 flake8-docstrings isort + - name: Run flake8 + run: flake8 + - name: Run isort + run: isort ./ --check + - name: Run black + run: black ./ --check + - name: Run test install + run: pip install . From 9dd7c3e6f39783ef6107f90eab095509891d17bc Mon Sep 17 00:00:00 2001 From: bullitt168 Date: Sun, 27 Aug 2023 08:11:15 +0200 Subject: [PATCH 4/8] Revert "Merge branch 'fsantini:master' into master" This reverts commit a6960428b6528d1b4296a47fac0a6cdef780097a, reversing changes made to dab6c6e34d40e18a0a5b94a3f9a483f05265cfa1. --- e3dc/_e3dc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/e3dc/_e3dc.py b/e3dc/_e3dc.py index 0d164f2..2b71676 100644 --- a/e3dc/_e3dc.py +++ b/e3dc/_e3dc.py @@ -846,11 +846,11 @@ def get_db_data_timestamp( { "autarky": , "bat_power_in": , - "bat_power_out": , + "bat_power_out": , "consumed_production": , "consumption": , - "grid_power_in": , - "grid_power_out": , + "grid_power_in": , + "grid_power_out": , "startTimestamp": , "stateOfCharge": , "solarProduction": , @@ -908,11 +908,11 @@ def get_db_data( { "autarky": , "bat_power_in": , - "bat_power_out": , + "bat_power_out": , "consumed_production": , "consumption": , - "grid_power_in": , - "grid_power_out": , + "grid_power_in": , + "grid_power_out": , "startDate": , "stateOfCharge": , "solarProduction": , From ba80c444277647f4717df983101be8a0219ba229 Mon Sep 17 00:00:00 2001 From: bullitt168 Date: Sun, 27 Aug 2023 08:11:18 +0200 Subject: [PATCH 5/8] Revert "Create validate.yaml" This reverts commit dab6c6e34d40e18a0a5b94a3f9a483f05265cfa1. --- .github/workflows/validate.yaml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/workflows/validate.yaml diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml deleted file mode 100644 index a1e5883..0000000 --- a/.github/workflows/validate.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Run validation - -on: [push, pull_request] - -jobs: - validate: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install black flake8 flake8-docstrings isort - - name: Run flake8 - run: flake8 - - name: Run isort - run: isort ./ --check - - name: Run black - run: black ./ --check - - name: Run test install - run: pip install . From 4e21b49769e885cb29fbc8f11a1cc49cf826b0d2 Mon Sep 17 00:00:00 2001 From: Bastian Stahmer Date: Sun, 30 Nov 2025 11:28:53 +0000 Subject: [PATCH 6/8] added new PM_TYPEs and increased robustness --- e3dc/_rscpTags.py | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/e3dc/_rscpTags.py b/e3dc/_rscpTags.py index 9411338..ad52433 100644 --- a/e3dc/_rscpTags.py +++ b/e3dc/_rscpTags.py @@ -3622,6 +3622,9 @@ class PowermeterType(Enum): PM_TYPE_UNUSED = 0x06 PM_TYPE_WALLBOX = 0x07 PM_TYPE_FARM_ADDITIONAL = 0x08 + PM_TYPE_DATA_DISPLAY = 0x09 + PM_TYPE_REGULATION_BYPASS = 0x0A + PM_TYPE_ADDITIONAL_PRODUCTION_NO_STORAGE = 0x0B class PviType(Enum): @@ -3799,13 +3802,18 @@ def getStrPowermeterType(powermetertype: int | str | PowermeterType) -> str: Returns: str: The name of the power meter type as a string. + Returns "PM_TYPE_UNDEFINED" for unknown types. """ - if isinstance(powermetertype, int): - powermetertype = PowermeterType(powermetertype) - elif isinstance(powermetertype, str): - powermetertype = PowermeterType[powermetertype] + try: + if isinstance(powermetertype, int): + powermetertype = PowermeterType(powermetertype) + elif isinstance(powermetertype, str): + powermetertype = PowermeterType[powermetertype] - return powermetertype.name + return powermetertype.name + except (ValueError, KeyError) as e: + print(f"Warning: Unknown PowermeterType '{powermetertype}' encountered. Returning PM_TYPE_UNDEFINED. Error: {e}") + return PowermeterType.PM_TYPE_UNDEFINED.name def getStrPviType(pvitype: int | str | PviType) -> str: @@ -3819,10 +3827,15 @@ def getStrPviType(pvitype: int | str | PviType) -> str: Returns: str: The name of the pvi type as a string. + Returns "PVI_TYPE_UNDEFINED" for unknown types. """ - if isinstance(pvitype, int): - pvitype = PviType(pvitype) - elif isinstance(pvitype, str): - pvitype = PviType[pvitype] + try: + if isinstance(pvitype, int): + pvitype = PviType(pvitype) + elif isinstance(pvitype, str): + pvitype = PviType[pvitype] - return pvitype.name + return pvitype.name + except (ValueError, KeyError) as e: + print(f"Warning: Unknown PviType '{pvitype}' encountered. Returning PVI_TYPE_UNDEFINED. Error: {e}") + return PviType.PVI_TYPE_UNDEFINED.name From f98fec2a221f46d17cb6627dd64994070b9cace6 Mon Sep 17 00:00:00 2001 From: Bastian Stahmer Date: Sun, 30 Nov 2025 11:34:40 +0000 Subject: [PATCH 7/8] black reformatting --- e3dc/_rscpTags.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/e3dc/_rscpTags.py b/e3dc/_rscpTags.py index ad52433..f8662a0 100644 --- a/e3dc/_rscpTags.py +++ b/e3dc/_rscpTags.py @@ -3812,7 +3812,9 @@ def getStrPowermeterType(powermetertype: int | str | PowermeterType) -> str: return powermetertype.name except (ValueError, KeyError) as e: - print(f"Warning: Unknown PowermeterType '{powermetertype}' encountered. Returning PM_TYPE_UNDEFINED. Error: {e}") + print( + f"Warning: Unknown PowermeterType '{powermetertype}' encountered. Returning PM_TYPE_UNDEFINED. Error: {e}" + ) return PowermeterType.PM_TYPE_UNDEFINED.name @@ -3837,5 +3839,7 @@ def getStrPviType(pvitype: int | str | PviType) -> str: return pvitype.name except (ValueError, KeyError) as e: - print(f"Warning: Unknown PviType '{pvitype}' encountered. Returning PVI_TYPE_UNDEFINED. Error: {e}") + print( + f"Warning: Unknown PviType '{pvitype}' encountered. Returning PVI_TYPE_UNDEFINED. Error: {e}" + ) return PviType.PVI_TYPE_UNDEFINED.name From 175966fafb35eeca543aac01e17bc2e95acbc731 Mon Sep 17 00:00:00 2001 From: bullitt168 Date: Sun, 30 Nov 2025 17:02:10 +0100 Subject: [PATCH 8/8] fix: correct typos in comments for battery and grid power descriptions --- e3dc/_e3dc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/e3dc/_e3dc.py b/e3dc/_e3dc.py index b47ad69..62faa0d 100644 --- a/e3dc/_e3dc.py +++ b/e3dc/_e3dc.py @@ -694,11 +694,11 @@ def get_db_data_timestamp( { "autarky": , "bat_power_in": , - "bat_power_out": , + "bat_power_out": , "consumed_production": , "consumption": , - "grid_power_in": , - "grid_power_out": , + "grid_power_in": , + "grid_power_out": , "startTimestamp": , "stateOfCharge": , "solarProduction": , @@ -779,11 +779,11 @@ def get_db_data( { "autarky": , "bat_power_in": , - "bat_power_out": , + "bat_power_out": , "consumed_production": , "consumption": , - "grid_power_in": , - "grid_power_out": , + "grid_power_in": , + "grid_power_out": , "startDate": , "stateOfCharge": , "solarProduction": ,