Skip to content

Commit 89415b9

Browse files
committed
VERSION
1 parent 14acff0 commit 89415b9

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# private/local config
22
options.yaml
33
config.localtest.yaml
4+
VERSION
45

56
.mypy_cache/
67
.pytest_cache/

‎hass-addon-sunsynk-multi/Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ RUN set -x \
1919
./sunsynk[umodbus,solarman]
2020

2121
COPY rootfs /
22+
COPY VERSION VERSION

‎scripts/copy2local.cmd‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ cp %~1\config.yaml %cf%
1818
sed -i 's/image:/# image:/' %cf%
1919
sed -i 's/name: /name: A_LOCAL /' %cf%
2020
xcopy /Y %cf% %~2\config.yaml
21+
echo 0.0.0 > %~1\VERSION
2122

2223
echo # Copy '%~1' to '%~2'
2324
xcopy /Y /S /EXCLUDE:scripts\copyexclude.txt %~1 %~2

‎src/ha_addon_sunsynk_multi/__main__.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ async def main_loop() -> int:
3030
await OPT.init_addon()
3131

3232
# Print version added during build & pyproject version
33-
vfile = Path(__file__) / "../../../../VERSION"
34-
ver = vfile.read_text().strip() if vfile.exists() else ""
33+
ver = ""
34+
try:
35+
for parent in Path(__file__).parents:
36+
vfile = parent / "VERSION"
37+
if vfile.exists():
38+
ver = vfile.read_text().strip()
39+
break
40+
except Exception:
41+
pass
3542
_LOG.info("sunsynk library version: %s (%s)", VERSION, ver)
3643

3744
try:

0 commit comments

Comments
 (0)