Skip to content

0.0.13b6

Pre-release
Pre-release

Choose a tag to compare

@dmoo500 dmoo500 released this 06 Apr 15:50

Fix ekz_ha.reset_statistics: robust fallback for different HA versions

The previous b5 release could fail with "async_clear_statistics is not available" on some HA versions. This release adds two fallback layers:

  1. Module-level import (most HA versions): from homeassistant.components.recorder.statistics import async_clear_statistics
  2. Recorder instance method (some HA versions): get_recorder_instance(hass).async_clear_statistics(statistic_ids)

Both sync (@callback) and async versions are handled automatically. If neither API is available, a clear error message is logged instead of silently returning.