Add comment explaining stats entity refresh request

Explain why HassioStatsEntity.async_added_to_hass requests a
coordinator refresh: stats are only fetched for containers with
subscribed entities, and the first coordinator refresh has no
subscribers yet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stefan Agner
2026-04-08 16:19:47 +02:00
parent f0d79f0af4
commit 9f91d906d2

View File

@@ -77,6 +77,10 @@ class HassioStatsEntity(CoordinatorEntity[HassioStatsDataUpdateCoordinator]):
self._container_id, self.entity_id, {CONTAINER_STATS}
)
)
# Stats are only fetched for containers with subscribed entities.
# The first coordinator refresh (before entities exist) has no
# subscribers, so no stats are fetched. Request a refresh now
# that this entity has registered its subscription.
await self.coordinator.async_request_refresh()