Fix BrightSky weather prediction

- Get weather data with fully specified end_date datetime argument to not miss data.
- Make preciptable water records generation robust against missing temperature
  or humidity values.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
Bobby Noelte
2025-01-22 23:47:28 +01:00
parent 694655311f
commit c8cad0f277
6 changed files with 1665 additions and 9622 deletions

View File

@@ -162,10 +162,7 @@ def test_update_data(mock_get, provider, sample_brightsky_1_json, cache_store):
# Assert: Verify the result is as expected
mock_get.assert_called_once()
assert len(provider) == 338
# with open(FILE_TESTDATA_WEATHERBRIGHTSKY_2_JSON, "w") as f_out:
# f_out.write(provider.to_json())
assert len(provider) == 50
# ------------------------------------------------
@@ -188,3 +185,8 @@ def test_brightsky_development_forecast_data(provider, config_eos, is_system_tes
with FILE_TESTDATA_WEATHERBRIGHTSKY_1_JSON.open("w", encoding="utf-8", newline="\n") as f_out:
json.dump(brightsky_data, f_out, indent=4)
provider.update_data(force_enable=True, force_update=True)
with FILE_TESTDATA_WEATHERBRIGHTSKY_2_JSON.open("w", encoding="utf-8", newline="\n") as f_out:
f_out.write(provider.model_dump_json(indent=4))

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff