Skip to content

v1.8.3

Choose a tag to compare

@eXPerience83 eXPerience83 released this 24 Nov 15:10
8536054

🌼 Pollen Levels v1.8.3

Stable release for the 1.8.x line.
Focus: stricter privacy around coordinates, more helpful diagnostics, rock-solid authentication, and safer parsing — all backed by regression tests to keep it that way.


🚀 Highlights (since 1.7.8)

  • 🗺️ Privacy-first coordinates & diagnostics

    • All raw latitude/longitude values are redacted from config-flow errors and warnings, including the “Unique ID setup failed” path.
    • Diagnostics include an approximate, rounded location under dedicated keys so support can see rough geography while precise coordinates stay private.
    • Approximate coordinates are rounded to a single decimal place, tightening privacy while keeping diagnostics useful.
  • 🔐 Reliable re-authentication

    • Config entries missing the API key now raise ConfigEntryAuthFailed during sensor setup, so Home Assistant immediately prompts for reauthentication instead of crashing with KeyError.
    • Auth failures (including Google Pollen API 403 responses and forwarded platform errors) propagate as ConfigEntryAuthFailed, rather than being wrapped as connectivity issues, so users see the proper re-auth dialog.
  • 🗺️ Validated, localized coordinates

    • Latitude/longitude are validated directly in the config-flow error handling, surfacing a localized invalid_coordinates error instead of a traceback.
    • Strict geographic limits (±90°, ±180°) are enforced before calling the API, rejecting impossible coordinates early and consistently across locales.
    • BCP-47 language codes are validated with localized messages, ensuring invalid language settings are reported cleanly in every translation file.
  • 📡 Consistent data and sensors

    • Setup no longer completes with empty pollen data: when dailyInfo is missing, the config entry is marked as ConfigEntryNotReady and retried until real data is available.
    • Pollen type metadata is rebuilt from future forecast days when today lacks dailyInfo, so source="type" sensors keep their forecast attributes.
    • Plant sensors retain forecast-style attributes (trend, expected_peak, per-day values) even when only future days are available.
  • 🧼 Cleaner, safer logging

    • API-key redaction is centralized and reused by the config flow, coordinator, and diagnostics for consistent logging hygiene.
    • Non-UTF-8 payloads are decoded with replacement before sanitizing, preventing crashes while still redacting secrets.
    • Config-flow credential validation evaluates the HTTP status before decoding any body content, avoiding large/binary logging on failures.
  • 🎛️ Smoother integration UX

    • New friendly entry name field during setup so new installations appear with personalized, readable titles from day one.
    • The force_update service name and description have been moved into translation files with English and Spanish entries, improving internationalization.
    • Reauthentication confirmation screens are localized and unused step strings have been removed to reduce translator burden.
  • 🧪 Stronger test suite

    • Regression coverage ensures:
      • ConfigEntryAuthFailed is propagated correctly while only unexpected exceptions are wrapped in ConfigEntryNotReady.
      • Non-numeric and out-of-range coordinates are rejected with the new translation-aware error key.
      • One-day vs. multi-day payload shaping for pollen types and plants keeps sensors’ forecast metadata intact.
    • These tests guard validation, parsing, and re-auth behavior against regressions in future releases.
  • 🛠️ Under-the-hood refinements

    • Pollen-type metadata helpers are simplified (closure-based, less branching) without behavior changes.
    • D+1/D+2 entities are reliably removed in sync with the Entity Registry when options change.
    • Validation timeouts align with the coordinator (ClientTimeout(total=10)).
    • CI workflows install the latest stable Black and Ruff releases to inherit upstream bugfixes automatically.

🧾 Detailed changes by version

1.8.3 – Privacy, diagnostics & translations

Fixed

  • Stop logging coordinate values through the invalid-coordinate exception message in the config flow; messages are now static and fully redacted.
  • Redact raw coordinates from the “Unique ID setup failed” error log in the config flow to strictly align with the integration’s privacy standards.
  • Stop logging raw latitude/longitude in config-flow coordinate warnings; values are now redacted to better align with the integration’s privacy guarantees.
  • Keep the approximate diagnostics location visible by renaming rounded coordinates to dedicated keys and reducing precision to a single decimal place for better privacy.

Changed

  • Added an approximate, rounded location to diagnostics so support can review rough geography without exposing precise coordinates while keeping exact values redacted.
  • Moved the force_update service name and description into translation files and added English and Spanish entries to improve internationalization.
  • Synced the manifest version with the release notes to finalize the stable 1.8.3 release.

1.8.2 – Auth handling, coordinates & regression tests

Fixed

  • Detect config entries missing the API key during sensor setup and raise ConfigEntryAuthFailed immediately so Home Assistant prompts for reauthentication instead of crashing with KeyError.
  • Let ConfigEntryAuthFailed escape the setup wrapper so Home Assistant immediately prompts for reauthentication when the forwarded sensor platform reports invalid credentials.
  • Validate latitude/longitude inside the config-flow error handling so invalid coordinates surface a localized invalid_coordinates error instead of crashing the form.
  • Enforce geographic range limits (±90°, ±180°) on latitude/longitude during validation so impossible coordinates are rejected before hitting the API.
  • Restrict the Date sensor’s ISO parsing handler to ValueError/TypeError so unexpected issues propagate while malformed payloads still log a clear error.
  • Update config-flow credential validation to evaluate the HTTP status before decoding the body, avoiding large/binary logging on failures and ensuring missing dailyInfo is handled as a clean cannot_connect error.

Added

  • Regression tests validating that the setup wrapper:
    • Propagates authentication failures via ConfigEntryAuthFailed.
    • Still wraps only unexpected exceptions in ConfigEntryNotReady.
  • Config-flow regression coverage ensuring:
    • Non-numeric coordinates are rejected with the new translation-aware error key, localized across every language file.
    • Out-of-range coordinates (beyond physical lat/long limits) are rejected by validation.

Changed

  • Removed unused reauthentication step strings so locales only maintain the confirmation form that users actually interact with during credential refreshes.
  • Simplified the pollen-type metadata fallback helper by relying on closure variables, improving readability without changing behavior.
  • Streamlined the pollen-type metadata lookup to scan each forecast day once, reducing branching and keeping the fallback path easier to follow.

1.8.1 – Friendly entry names

Added

  • Allow configuring a friendly entry name during setup so new installations appear with personalized titles out of the box.

Changed

  • Localized the entry-name field across every supported language to keep the setup form consistent worldwide.

1.8.0 – Data robustness, re-auth, and CI

Fixed

  • Prevent completing setup with empty pollen data by raising ConfigEntryNotReady until the API includes daily information, ensuring entities populate correctly.
  • Rebuild pollen type metadata from future forecast days when today lacks dailyInfo, keeping sensors classified as source="type" with their forecast attributes.
  • Treat 403 authentication failures from the Google Pollen API as ConfigEntryAuthFailed so Home Assistant immediately prompts for re-authentication instead of leaving the entry broken.
  • Prevent crashes while redacting API keys when providers return non-UTF-8 payloads by decoding bytes with replacement before sanitizing logs.
  • Restore the re-authentication reload path by updating entries and reloading them separately, avoiding AttributeError from the previous helper call.
  • Surface canonical BCP-47 validation errors with localized messaging instead of raw exception text, covering every translation file.
  • Ensure stale D+1/D+2 entities are actually removed by awaiting entity-registry cleanup before finishing setup adjustments.
  • Localize the reauthentication confirmation form so translated titles and descriptions appear when refreshing credentials.

Added

  • Regression tests covering single-day and multi-day API payload shaping to ensure pollen type sensors retain forecast metadata when only future indices are available.
  • Regression coverage for plant forecast attributes so plant sensors continue to expose trend, peak, and per-day values.

Changed

  • Unique ID assignment now logs a redacted stack trace and aborts setup on unexpected failures while still handling normal duplicate locations gracefully.
  • Validation timeout aligns with the coordinator ceiling (ClientTimeout(total=10)) so probing the API cannot hang longer than runtime refreshes.
  • Added a dedicated re-authentication step that reuses validation logic, only requests the API key, and reloads the entry automatically once credentials are refreshed.
  • Centralized API-key redaction into a shared helper reused by the config flow, coordinator, and diagnostics for consistent logging hygiene.
  • Continuous-integration workflows now install the latest Black and Ruff releases to inherit upstream bug fixes without manual updates.

Full Changelog: v1.7.8...v1.8.3