fix: default server settings prevent env var config (#1234)

Change configuration source priorities to:

- cli
- environment vars
- dotenv settings
- config file settings
- init settings

By this the environment vars supersede any configuration var
provided by the configuration file or by the initialisation
with pydantic.

The test_config.py::test_computed_path was fixed to to not
use the defaul env var overwrite defined by conftest.py.
This seemed to indicate non working env vars, but in fact
was a test setupt fault.

Besides this fix there are other fixes and changes added:

* fix: exclude computed fields when merging settings

  Pydantic may overwrite settings by values given for computed
  fields and use these values instead of re-computing the field.
  Avoid computed fields in merging settings.

* chore: improve Windows compatability of development setup

  Improve scripts to better run also on Windows. When doing path
  checks keep compatibility also to Windows pathes. A lot of
  changes to avoid the famous Windows CRLF handling and keep
  line endings to LF.

* chore: add development hint for Windows

  Windows developers should set core.autocrlf to false.

* chore: update version

Signed-off-by: b0661 <b0661n0e17e@gmail.com>
This commit is contained in:
Bobby Noelte
2026-08-16 13:56:25 +02:00
committed by GitHub
parent 269d2162a9
commit 886c93c92b
18 changed files with 525 additions and 345 deletions
+7 -1
View File
@@ -49,8 +49,14 @@ def test_config_constants(config_eos):
assert config_eos.CONFIG_FILE_NAME == "EOS.config.json"
def test_computed_paths(config_eos):
def test_computed_paths(config_eos, monkeypatch):
"""Test computed paths for output and cache."""
# Ensure we do not have the environment patched by conftest.py
monkeypatch.delenv("EOS_GENERAL__DATA_FOLDER_PATH", raising=False)
monkeypatch.delenv("EOS_GENERAL__DATA_CACHE_SUBPATH", raising=False)
monkeypatch.delenv("EOS_GENERAL__DATA_OUTPUT_SUBPATH", raising=False)
# Don't actually try to create the data folder
with patch("pathlib.Path.mkdir"), \
patch("pathlib.Path.is_dir", return_value=True), \
+2 -2
View File
@@ -48,7 +48,7 @@ class TestHomeAssistantAddon:
readme_path = self.root / "README.md"
assert readme_path.is_file(), "README.md must exist in the repository root."
content = readme_path.read_text()
content = readme_path.read_text(encoding="utf-8")
assert len(content.strip()) > 0, "README.md is empty"
print(f"✓ README.md exists ({len(content)} bytes)")
@@ -58,7 +58,7 @@ class TestHomeAssistantAddon:
docs_path = self.root / "DOCS.md"
assert docs_path.is_file(), "DOCS.md must exist in the repository root for add-on documentation."
content = docs_path.read_text()
content = docs_path.read_text(encoding="utf-8")
assert len(content.strip()) > 0, "DOCS.md is empty"
print(f"✓ DOCS.md exists ({len(content)} bytes)")
+1 -1
View File
@@ -87,7 +87,7 @@ The Node-RED adapter sends to HTTP IN nodes.
This is the example flow:
[HTTP In \\<URL\\>] -> [Function (parse payload)] -> [Debug] -> [HTTP Response]
`[HTTP In <URL>] -> [Function (parse payload)] -> [Debug] -> [HTTP Response]`
There are two URLs that are used: