Skip to content

Commit afa5bfb

Browse files
committed
MQTT_CUSTOM & docs
1 parent 9393169 commit afa5bfb

11 files changed

Lines changed: 61 additions & 193 deletions

File tree

‎.coveragerc‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525

2626
env:
2727
RUFF_VERSION: 0.13.1
28-
UV_VERSION: 0.8.19
28+
UV_VERSION: 0.9.5
2929

3030
jobs:
3131
ruff:

‎.gitignore‎

Lines changed: 9 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
**/.*.json
2-
**/.*.yaml
3-
.data/*
4-
.data
5-
.id
6-
.venv
7-
# private config
1+
# private/local config
82
options.yaml
9-
103
config.localtest.yaml
114

5+
.mypy_cache/
6+
.pytest_cache/
7+
.python-version
8+
.venv
9+
cov.xml
10+
.coverage
11+
.ruff_cache/
12+
1213
# Byte-compiled / optimized / DLL files
1314
__pycache__/
1415
*.py[cod]
1516
*$py.class
1617
.DS_Store
1718

18-
# C extensions
19-
*.so
20-
2119
# Distribution / packaging
2220
.Python
2321
build/
@@ -38,111 +36,3 @@ share/python-wheels/
3836
.installed.cfg
3937
*.egg
4038
MANIFEST
41-
42-
# PyInstaller
43-
# Usually these files are written by a python script from a template
44-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
45-
*.manifest
46-
*.spec
47-
48-
# Installer logs
49-
pip-log.txt
50-
pip-delete-this-directory.txt
51-
52-
# Unit test / coverage reports
53-
htmlcov/
54-
.tox/
55-
.nox/
56-
.coverage
57-
.coverage.*
58-
.cache
59-
nosetests.xml
60-
coverage.xml
61-
*.cover
62-
*.py,cover
63-
.hypothesis/
64-
.pytest_cache/
65-
66-
# Translations
67-
*.mo
68-
*.pot
69-
70-
# Django stuff:
71-
*.log
72-
local_settings.py
73-
db.sqlite3
74-
db.sqlite3-journal
75-
76-
# Flask stuff:
77-
instance/
78-
.webassets-cache
79-
80-
# Scrapy stuff:
81-
.scrapy
82-
83-
# Sphinx documentation
84-
docs/_build/
85-
86-
# PyBuilder
87-
target/
88-
89-
# Jupyter Notebook
90-
.ipynb_checkpoints
91-
92-
# IPython
93-
profile_default/
94-
ipython_config.py
95-
96-
# pyenv
97-
.python-version
98-
99-
# pipenv
100-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
101-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
102-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
103-
# install all needed dependencies.
104-
#Pipfile.lock
105-
106-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
107-
__pypackages__/
108-
109-
# Celery stuff
110-
celerybeat-schedule
111-
celerybeat.pid
112-
113-
# SageMath parsed files
114-
*.sage.py
115-
116-
# Environments
117-
.env
118-
.venv
119-
env/
120-
venv/
121-
ENV/
122-
env.bak/
123-
venv.bak/
124-
125-
# Spyder project settings
126-
.spyderproject
127-
.spyproject
128-
129-
# Rope project settings
130-
.ropeproject
131-
132-
# mkdocs documentation
133-
/site
134-
135-
# mypy
136-
.mypy_cache/
137-
.dmypy.json
138-
dmypy.json
139-
140-
# Pyre type checker
141-
.pyre/
142-
143-
# Vscode settings
144-
.vscode/
145-
146-
.ruff_cache/
147-
.venv/
148-
cov.xml

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/uv-pre-commit
3-
rev: 0.8.19
3+
rev: 0.9.5
44
hooks:
55
- id: uv-lock
66

‎.vscode/settings.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"cSpell.words": [
3+
"Deye",
4+
"hass",
5+
"hassio",
6+
"mbusd",
7+
"mosquitto",
8+
"MQTT",
9+
"Sunsynk",
10+
"umodbus"
11+
],
12+
"cSpell.ignoreRandomStrings": true
13+
}

‎hass-addon-mbusd/icon.png‎

6.68 KB
Loading

‎hass-addon-sunsynk-multi/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ COPY sunsynk sunsynk
1212
RUN set -x \
1313
# && apk add --no-cache --virtual .build-deps \
1414
# build-base \
15-
&& curl -LsSf https://astral.sh/uv/0.8.19/install.sh | sh \
15+
&& curl -LsSf https://astral.sh/uv/0.9.5/install.sh | sh \
1616
&& uv venv \
1717
&& uv pip install --index-strategy unsafe-best-match \
1818
./sunsynk[umodbus,solarman]

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
build-backend = "uv_build"
3-
requires = [ "uv-build>=0.8.20,<0.9" ]
3+
requires = [ "uv-build>=0.9,<0.10" ]
44

55
[project]
66
name = "sunsynk"

‎src/sunsynk/__init__.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
"""Sunsynk library."""
22

3+
from importlib import metadata
34
from typing import Final
45

56
from sunsynk.helpers import NumType, ValType
67
from sunsynk.rwsensors import RWSensor
78
from sunsynk.sensors import EnumSensor, Sensor, SensorDefinitions
89
from sunsynk.sunsynk import Sunsynk
910

10-
VERSION = "0.8.2"
11-
1211
AMPS: Final = "A"
1312
CELSIUS: Final = "°C"
1413
HZ: Final = "Hz"
1514
KWH: Final = "kWh"
1615
VOLT: Final = "V"
1716
WATT: Final = "W"
1817

18+
VERSION = metadata.version("sunsynk")
19+
1920
__all__ = [
21+
"VERSION",
2022
"EnumSensor",
2123
"NumType",
2224
"RWSensor",

‎src/tests/ha_addon_sunsynk_multi/test_versions.py‎

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import re
55
from pathlib import Path
66

7+
from sunsynk import VERSION
8+
79
ADDON_PATH = "hass-addon-sunsynk-multi"
810

911
_LOG = logging.getLogger(__name__)
@@ -15,15 +17,7 @@ def test_versions() -> None:
1517
config.json - contains the HASS addon version
1618
setup.py - sunsynk library on pypi
1719
"""
18-
v_setup = _get_version(
19-
filename="src/sunsynk/__init__.py",
20-
regex=r'VERSION = "(.+)"',
21-
)[0]
22-
23-
# v_docker = _get_version(
24-
# filename=f"{ADDON_PATH}/Dockerfile",
25-
# regex=r"sunsynk(?:\[[^\]]+\])?==([0-9.]+)",
26-
# )[0]
20+
v_setup = VERSION
2721

2822
v_config = _get_version(
2923
filename=f"{ADDON_PATH}/config.yaml",
@@ -37,9 +31,6 @@ def test_versions() -> None:
3731
v_config,
3832
)
3933

40-
# assert v_setup == v_docker
41-
# assert v_setup == v_config
42-
4334

4435
def _get_version(filename: str, regex: str) -> list[str]:
4536
txt = Path(filename).read_text(encoding="utf-8")
@@ -48,21 +39,3 @@ def _get_version(filename: str, regex: str) -> list[str]:
4839
assert res, f"pattern not found in {filename}"
4940
_LOG.info("\t%s\t%s", res[0], filename)
5041
return res
51-
52-
53-
# def test_deps() -> None:
54-
# """Check deps."""
55-
# regex = r" ([^ ]+\d)(\s|$)"
56-
57-
# v_docker = _get_version(
58-
# filename=f"{ADDON_PATH}/Dockerfile",
59-
# regex=regex,
60-
# )
61-
62-
# v_setup = _get_version(
63-
# filename="setup.cfg",
64-
# regex=regex,
65-
# )
66-
# v_setup = [v for v in v_setup if not v.startswith("ruff")]
67-
68-
# assert " ".join(sorted(v_setup)) == " ".join(sorted(v_docker))

0 commit comments

Comments
 (0)