Fix preview available in statistics (#127349)

pull/127501/head
G Johansson 2024-10-03 22:27:01 +02:00 committed by GitHub
parent db494de809
commit 80582a128a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -385,7 +385,7 @@ class StatisticsSensor(SensorEntity):
if not self._source_entity_id or (
self._samples_max_buffer_size is None and self._samples_max_age is None
):
self._attr_available = False
self._available = False
calculated_state = self._async_calculate_state()
preview_callback(calculated_state.state, calculated_state.attributes)
return self._call_on_remove_callbacks