Problem
HA 2026.11 will break our long-term statistics imports. The following warning appears in the HA log on every startup (3 occurrences — CGM, IOB, basal):
WARNING [homeassistant.helpers.frame] Detected that custom integration 'carelink' doesn't specify
mean_type when calling async_import_statistics at custom_components/carelink/__init__.py,
line 1997: async_import_statistics(self.hass, cgm_meta, cgm_stats).
This will stop working in Home Assistant 2026.11, please create a bug report.
Affected code
__init__.py — three async_import_statistics calls around lines 1997, 2012, 2027:
async_import_statistics(self.hass, cgm_meta, cgm_stats) # line 1997
async_import_statistics(self.hass, iob_meta, iob_stats) # line 2012
async_import_statistics(self.hass, basal_meta, basal_stats) # line 2027
Fix required
Add mean_type=StatisticMeanType.ARITHMETIC to all three calls:
from homeassistant.components.recorder.statistics import StatisticMeanType
async_import_statistics(self.hass, cgm_meta, cgm_stats, mean_type=StatisticMeanType.ARITHMETIC)
async_import_statistics(self.hass, iob_meta, iob_stats, mean_type=StatisticMeanType.ARITHMETIC)
async_import_statistics(self.hass, basal_meta, basal_stats, mean_type=StatisticMeanType.ARITHMETIC)
Blocker
mean_type parameter is not yet available in the HA API as of 2026.2/2026.3 (coming in HA 2026.11). We cannot add this fix until HA 2026.11 ships (approx. November 2026).
Action
- Monitor HA 2026.11 release notes for
StatisticMeanType availability
- Apply the fix before HA 2026.11 goes stable
- Update
tests/ to cover the new parameter
Problem
HA 2026.11 will break our long-term statistics imports. The following warning appears in the HA log on every startup (3 occurrences — CGM, IOB, basal):
Affected code
__init__.py— threeasync_import_statisticscalls around lines 1997, 2012, 2027:Fix required
Add
mean_type=StatisticMeanType.ARITHMETICto all three calls:Blocker
mean_typeparameter is not yet available in the HA API as of 2026.2/2026.3 (coming in HA 2026.11). We cannot add this fix until HA 2026.11 ships (approx. November 2026).Action
StatisticMeanTypeavailabilitytests/to cover the new parameter