Skip to content

Android: add forecast widgets (Solar/Price/CO2/Feed-in) - #284

Draft
webalexeu wants to merge 1 commit into
evcc-io:mainfrom
webalexeu:feat/android-widgets-forecast-v2
Draft

webalexeu wants to merge 1 commit into
evcc-io:mainfrom
webalexeu:feat/android-widgets-forecast-v2

Conversation

@webalexeu

Copy link
Copy Markdown
Contributor

Replaces #264, rebased onto main after #255/#283 landed.

Adds the four forecast widgets (Solar/Price/CO₂/Feed-in) that #264 introduced, but re-ported onto the current Glance/Preferences widget architecture instead of the pre-#255 one #264 was built against — this is an alignment pass with the Loadpoint widget work in #255, not a straight rebase, since #255 replaced the old WidgetConfig/SharedPreferences state mechanism and manual broadcast refresh with per-instance updateAppWidgetState.

TODO

Rebases and re-ports evcc-io#264 onto the current Glance/Preferences widget
architecture introduced by evcc-io#255, applying the same simplifications:
per-instance state via updateAppWidgetState (no WidgetConfig/SharedPreferences,
no manual broadcast refresh), a rounded card matching Loadpoint's chrome, and
reuse of Loadpoint's typography tokens for shared message/not-configured
states instead of bespoke ones. Also applies the last-known-data cache pattern
from evcc-io#283 so a transient fetch failure falls back to the last successful
response instead of flashing Unreachable; the config screen's live preview
stays uncached, matching LoadpointWidgetConfigActivity.

- ForecastWidget.kt/ForecastWidgetConfigActivity.kt rewritten against the
  Glance state APIs; ChartRenderer.kt (Canvas-based chart rasterization,
  unaffected by the architecture change) ported unchanged
- withAndroidWidget.ts: forecast receivers, appwidget-provider/preview XML,
  and config-activity manifest entries, styled like the Loadpoint preview
- Theme.kt: forecastPalette()/four new text styles, replacing ~13 old
  bespoke forecast styles now that message/not-configured states are shared
- new widget.androidConfig.* i18n keys (en/de) for the forecast config flow

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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