mirror of
https://github.com/home-assistant/core.git
synced 2026-04-27 06:36:43 +00:00
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:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user