💚 Declare recorder in after_dependencies for hassfest #53

Merged
mat merged 1 commit from fix-recorder-dep into main 2026-07-13 14:39:40 +00:00
Owner

Problem

The GitHub validate-hassfest job fails with:

[ERROR] [DEPENDENCIES] Using component recorder but it's not in 'dependencies' or 'after_dependencies'

Since #18, coordinator.py imports homeassistant.components.recorder (async_add_external_statistics, StatisticData, StatisticMetaData, StatisticMeanType) to emit external energy statistics. hassfest requires any HA component used by the integration to be declared in the manifest, but dependencies was empty.

Fix

Declare recorder in after_dependencies (not dependencies): the coordinator degrades gracefully when the recorder is absent —

if not buckets or "recorder" not in self.hass.config.components:
    return

so the recorder is optional. after_dependencies guarantees correct setup ordering when it is present, without forcing it to load for users who disabled it.

Verification

Ran the exact CI image (ghcr.io/home-assistant/hassfest) locally:

Integrations: 1
Invalid integrations: 0
## Problem The GitHub `validate-hassfest` job fails with: ``` [ERROR] [DEPENDENCIES] Using component recorder but it's not in 'dependencies' or 'after_dependencies' ``` Since #18, `coordinator.py` imports `homeassistant.components.recorder` (`async_add_external_statistics`, `StatisticData`, `StatisticMetaData`, `StatisticMeanType`) to emit external energy statistics. hassfest requires any HA component used by the integration to be declared in the manifest, but `dependencies` was empty. ## Fix Declare `recorder` in **`after_dependencies`** (not `dependencies`): the coordinator degrades gracefully when the recorder is absent — ```python if not buckets or "recorder" not in self.hass.config.components: return ``` so the recorder is optional. `after_dependencies` guarantees correct setup ordering when it is present, without forcing it to load for users who disabled it. ## Verification Ran the exact CI image (`ghcr.io/home-assistant/hassfest`) locally: ``` Integrations: 1 Invalid integrations: 0 ```
💚 Declare recorder in after_dependencies for hassfest
All checks were successful
Validate / lint-ruff (push) Successful in 7s
Validate / test-pytest (push) Successful in 3m5s
Validate / type-check-mypy (push) Successful in 3m7s
Validate / lint-ruff (pull_request) Successful in 7s
Validate / test-pytest (pull_request) Successful in 3m1s
Validate / type-check-mypy (pull_request) Successful in 3m7s
791a9e73a5
The coordinator imports homeassistant.components.recorder to emit external
energy statistics (added in #18), so hassfest requires recorder to be listed
in dependencies or after_dependencies. Using after_dependencies because the
integration degrades gracefully when the recorder is absent.
mat merged commit d9b3c2aaed into main 2026-07-13 14:39:40 +00:00
mat deleted branch fix-recorder-dep 2026-07-13 14:39:40 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mat/homeassistant-comwatt!53
No description provided.