From f7feddac6d12aa9cff4833eacd6ae96c4f35b129 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 4 Oct 2026 06:22:54 +0000 Subject: [PATCH 1/2] chore(deps): bump solar-positioning from 0.6.1 to 0.7.0 in /backend Bumps [solar-positioning](https://github.com/klausbrunner/solarpositioning-rs) from 0.6.1 to 0.7.0. - [Changelog](https://github.com/klausbrunner/solarpositioning-rs/blob/main/CHANGELOG.md) - [Commits](https://github.com/klausbrunner/solarpositioning-rs/compare/v0.6.1...v0.7.0) --- updated-dependencies: - dependency-name: solar-positioning dependency-version: 0.7.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- backend/Cargo.lock | 4 ++-- backend/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index c1cc5f82..767cab6b 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -2312,9 +2312,9 @@ dependencies = [ [[package]] name = "solar-positioning" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d6872cbbd3f5ae24ef8e5f759b235a080d3592c8ddbc0c38c8985b19f6c34a" +checksum = "33e67ad3108959c32cd9ab2515f7ced367e640c0454c6277f67c3dacc7d1d0a2" dependencies = [ "chrono", ] diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 320659e4..04241697 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -25,7 +25,7 @@ chrono = { version = "0.4", features = ["serde"] } chrono-tz = "0.10" quick-xml = "0.42" sun = "0.3" -solar-positioning = "0.6" +solar-positioning = "0.7" hmac = "0.13.0" sha1 = "0.11.0" md5 = "0.8.0" From 4c08ad19127b48ed0600dff43304195ede2e7fae Mon Sep 17 00:00:00 2001 From: Eetu Sutinen Date: Sun, 4 Oct 2026 09:40:07 +0300 Subject: [PATCH 2/2] fix(backend): port sun position to solar-positioning 0.7 SolarPositions API --- backend/src/pv/forecast/solar.rs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/backend/src/pv/forecast/solar.rs b/backend/src/pv/forecast/solar.rs index 0fdc4815..8c41705b 100644 --- a/backend/src/pv/forecast/solar.rs +++ b/backend/src/pv/forecast/solar.rs @@ -5,7 +5,7 @@ //! zenith is degrees from vertical. use chrono::{DateTime, Datelike, Utc}; -use solar_positioning::{spa, RefractionCorrection}; +use solar_positioning::{Location, RefractionCorrection, SolarPositions}; /// Observer elevation, atmosphere and ΔT used for the sun position. Refraction /// depends on the first three, but only near the horizon, so standard sea-level @@ -38,15 +38,18 @@ pub fn sun_state(time: DateTime, latitude: f64, longitude: f64) -> SunState let refraction = RefractionCorrection::new(PRESSURE_MBAR, TEMPERATURE_C) .expect("standard pressure and temperature are in range"); - let position = spa::solar_position( - time, - latitude, - longitude, - OBSERVER_ELEVATION_M, - DELTA_T_SECONDS, - Some(refraction), - ) - .expect("site coordinates are validated at settings load"); + let position = SolarPositions::new() + .at( + &time, + Location { + latitude, + longitude, + }, + OBSERVER_ELEVATION_M, + DELTA_T_SECONDS, + Some(refraction), + ) + .expect("site coordinates are validated at settings load"); let apparent_zenith = position.zenith_angle();