Skip to content

Commit

Permalink
Merge pull request #1 from ernestasga/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ernestasga committed Jan 17, 2024
2 parents 654bf2b + 1d941cc commit 0f2463b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python Tests
name: Tests

on: [push, pull_request]

Expand All @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
Expand All @@ -18,8 +18,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python3 -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
python -m unittest discover -s tests
python3 -m unittest discover -s tests
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Solar Frontier Inverter API

<p align="center">
<a href="https://www.python.org/downloads/">
<img src="https://img.shields.io/badge/Python-3-blue.svg"
alt="Python 3">
</a>
</p>
<div align="center">

[![Tests](https://github.com/ernestasga/python-solarfrontier/actions/workflows/test.yml/badge.svg)](https://github.com/ernestasga/python-solarfrontier/actions/workflows/test.yml)

![Python Version](https://img.shields.io/badge/python-3.8=<-blue.svg)
</div>
<p>
Python Library to retrieve data from "Solar Frontier" inverters on LAN. Able to get measurements, yield data, system info.
</p>

</div>



# Compatibility
**Confirmed to work with:**
Expand Down
3 changes: 2 additions & 1 deletion python_solarfrontier/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utility classes to work with device data."""
from typing import Tuple
import re


Expand Down Expand Up @@ -68,7 +69,7 @@ def parse_yield(html_content: str) -> str or None:
class UnitConverter:
"""Convert measurement units like kW, MWh to base units."""

def parse_measurement(self, measurement) -> tuple[int, str]:
def parse_measurement(self, measurement) -> Tuple[int, str]:
"""Parse the measurement into value and unit."""
# value is number or float, rest is unbit
value_match = re.search(r"^(\d+(\.\d+)?)\s*([a-zA-Z]+)$", measurement.strip())
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
aiohttp>=3.9.1
asyncio>=3.4.3
aiohttp==3.7.4
asyncio>=3.4.3
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
python_requires='>=3.8',
)

0 comments on commit 0f2463b

Please sign in to comment.