Compare commits
4 Commits
v0.14.0-re
...
s-allius/i
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbca07bd59 | ||
|
|
e66d2e864b | ||
|
|
e19acbc514 | ||
|
|
6798753d84 |
@@ -7,6 +7,7 @@ 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
|
||||
|
||||
@@ -15,6 +15,7 @@ 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
|
||||
|
||||
|
||||
@@ -31,11 +32,7 @@ class ProxyState:
|
||||
|
||||
|
||||
app = Quart(__name__)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
async def hello():
|
||||
return Response(response="Hello, world")
|
||||
app.register_blueprint(web_routes)
|
||||
|
||||
|
||||
@app.route('/-/ready')
|
||||
|
||||
9
app/src/web/routes.py
Normal file
9
app/src/web/routes.py
Normal file
@@ -0,0 +1,9 @@
|
||||
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")
|
||||
@@ -33,16 +33,6 @@ 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."""
|
||||
|
||||
15
app/tests/test_web_route.py
Normal file
15
app/tests/test_web_route.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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"
|
||||
@@ -83,7 +83,8 @@ 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)/gen3plus/*.py)\
|
||||
$(wildcard $(SRC_PROXY)/web/*.py)
|
||||
CNF_FILES := $(wildcard $(CNF_PROXY)/*.toml)
|
||||
|
||||
# determine destination files
|
||||
|
||||
@@ -106,3 +106,4 @@ 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
|
||||
|
||||
@@ -107,3 +107,4 @@ 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
|
||||
@@ -23,8 +23,11 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user