Compare commits

..

3 Commits

Author SHA1 Message Date
Stefan Allius
8d8b9a65d3 add unit test for some routes 2025-04-15 19:43:00 +02:00
Stefan Allius
774c4c82fa remove global proxy_is_up 2025-04-15 19:42:33 +02:00
Stefan Allius
8bf8c2e85d remove aiohttp by quart 2025-04-15 18:15:59 +02:00
10 changed files with 22 additions and 42 deletions

View File

@@ -1 +1 @@
3.13.2
3.13.3

View File

@@ -7,9 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased]
- add web UI to add-on
- allow `Y00` serial numbers for GEN3PLUS devices
## [0.13.0] - 2025-04-13
- update dependency python to 3.13

View File

@@ -15,7 +15,6 @@ from cnf.config import Config
from cnf.config_read_env import ConfigReadEnv
from cnf.config_read_toml import ConfigReadToml
from cnf.config_read_json import ConfigReadJson
from web.routes import web_routes
from modbus_tcp import ModbusTcp
@@ -32,7 +31,11 @@ class ProxyState:
app = Quart(__name__)
app.register_blueprint(web_routes)
@app.route('/')
async def hello():
return Response(response="Hello, world")
@app.route('/-/ready')

View File

@@ -1,9 +0,0 @@
from quart import Blueprint
from quart import Response
web_routes = Blueprint('web_routes', __name__)
@web_routes.route('/')
async def hello():
return Response(response="Hello, world")

View File

@@ -33,6 +33,16 @@ def test_get_log_level():
log_lvl = get_log_level()
assert log_lvl == None
@pytest.mark.asyncio
async def test_home():
"""Test the home route."""
client = app.test_client()
response = await client.get('/')
assert response.status_code == 200
result = await response.get_data()
assert result == b"Hello, world"
@pytest.mark.asyncio
async def test_ready():
"""Test the ready route."""

View File

@@ -1,15 +0,0 @@
# test_with_pytest.py
import pytest
from server import app
pytest_plugins = ('pytest_asyncio',)
@pytest.mark.asyncio
async def test_home():
"""Test the home route."""
client = app.test_client()
response = await client.get('/')
assert response.status_code == 200
result = await response.get_data()
assert result == b"Hello, world"

View File

@@ -83,8 +83,7 @@ SRC_FILES := $(wildcard $(SRC_PROXY)/*.py)\
$(wildcard $(SRC_PROXY)/cnf/*.py)\
$(wildcard $(SRC_PROXY)/cnf/*.toml)\
$(wildcard $(SRC_PROXY)/gen3/*.py)\
$(wildcard $(SRC_PROXY)/gen3plus/*.py)\
$(wildcard $(SRC_PROXY)/web/*.py)
$(wildcard $(SRC_PROXY)/gen3plus/*.py)
CNF_FILES := $(wildcard $(CNF_PROXY)/*.toml)
# determine destination files

View File

@@ -10,8 +10,8 @@ configuration:
Weitere wechselrichterspezifische Parameter (z.B. Polling Mode) können im
Konfigurationsblock gesetzt werden.
Die Seriennummer der GEN3 Wechselrichter beginnen mit 'R17' oder 'R47' und die der GEN3PLUS
Wechselrichter mit 'Y00', 'Y17' oder 'Y47'!
Die Seriennummer der GEN3 Wechselrichter beginnen mit `R17` oder `R47` und die der GEN3PLUS
Wechselrichter mit `Y17`oder `Y47`!
Siehe Beispielkonfiguration im Dokumentations-Tab
batteries:
@@ -106,4 +106,3 @@ configuration:
network:
5005/tcp: listening Port für TSUN GEN3 Wechselrichter
10000/tcp: listening Port für TSUN GEN3PLUS Wechselrichter
8127/tcp: Port für das TSUN-Proxy Dashboard

View File

@@ -10,7 +10,7 @@ configuration:
in the configuration block.
The serial numbers of all GEN3 inverters start with `R17` or `R47` and that of the GEN3PLUS
inverters with 'Y00', Y17 or Y47!
inverters with Y17 or Y47!
For reference see example configuration in Documentation Tab
@@ -107,4 +107,3 @@ configuration:
network:
5005/tcp: listening Port for TSUN GEN3 Devices
10000/tcp: listening Port for TSUN GEN3PLUS Devices
8127/tcp: Port for the TSUN-Proxy Dashboard

View File

@@ -23,11 +23,8 @@ services:
ports:
5005/tcp: 5005
10000/tcp: 10000
8127/tcp: 8127
webui: "http://[HOST]:[PORT:8127]/"
watchdog: "http://[HOST]:[PORT:8127]/-/healthy"
ingress: true
ingress_port: 8127
# Definition of parameters in the configuration tab of the addon
# parameters are available within the container as /data/options.json
@@ -35,7 +32,7 @@ ingress_port: 8127
schema:
inverters:
- serial: match(^(R17|R47|Y00|Y17|Y47).{13}$)
- serial: match(^(R17|R47|Y17|Y47).{13}$)
monitor_sn: int?
node_id: str
suggested_area: str