Skip to content

feat: CO2-only regulation via Wattnet by default - #15

Merged
pailozka merged 1 commit into
releasefrom
co2-wattnet-only
Oct 14, 2026
Merged

pailozka merged 1 commit into
releasefrom
co2-wattnet-only

Conversation

@pailozka

Copy link
Copy Markdown
Collaborator

No description provided.

…kens

- Ship a CO2-only [PIPELINE] (read power,cpufreq; score co2; act cpu_freq)
  as the default; no price fetch. Default CO2 backend is now Wattnet.
- Wattnet auth: WATTNET_EMAIL/WATTNET_PASSWORD replace WATTNET_API_KEY
  (Wattnet has no API keys). The 24 h token is fetched from
  /token-request/get_token, cached in /var/lib/hpc_eff/wattnet_token.json
  (mode 600), and renewed 10 min before expiry.
- A rejected token is answered with a 302 to the Wattnet login page, not a
  401. Redirects are no longer followed: 302/401 triggers one re-login,
  then a clear error.
- Wattnet parsing: merge all response series (final, pending, preview) so
  the current value is ~now instead of ~4 h old, and average per clock hour.
  Previously only the first series was read, so live calls always failed
  with "only 21/24 hourly values".
- CO2 fetch failure: reuse the last real grade if at most MAX_AGE_MIN (120)
  minutes old, else rating 1 (no slowdown without evidence). Fallback
  grades are never chained. The reason is logged as a WARNING and written
  to the state.json summary.
- deb postinst no longer enables cron on install (matches the rpm); it
  prints the setup steps instead. Upgrades keep an existing cron job.
- Docs: Wattnet login requirement and registration
  (https://api.wattnet.eu/token-request/), token handling, CO2 fallback,
  troubleshooting.
@pailozka
pailozka requested a review from dexter2cz October 13, 2026 14:11
@pailozka pailozka self-assigned this Oct 13, 2026
@pailozka
pailozka merged commit 8ee0cfa into release Oct 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant