mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Remove unneeded attributes selection from history_states api calls (#68409)
This commit is contained in:
parent
c5f3f9e924
commit
c223397098
@ -232,14 +232,16 @@ class HistoryStatsSensor(SensorEntity):
|
|||||||
def _update(self, start, end, now_timestamp, start_timestamp, end_timestamp):
|
def _update(self, start, end, now_timestamp, start_timestamp, end_timestamp):
|
||||||
# Get history between start and end
|
# Get history between start and end
|
||||||
history_list = history.state_changes_during_period(
|
history_list = history.state_changes_during_period(
|
||||||
self.hass, start, end, str(self._entity_id)
|
self.hass, start, end, str(self._entity_id), no_attributes=True
|
||||||
)
|
)
|
||||||
|
|
||||||
if self._entity_id not in history_list:
|
if self._entity_id not in history_list:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Get the first state
|
# Get the first state
|
||||||
last_state = history.get_state(self.hass, start, self._entity_id)
|
last_state = history.get_state(
|
||||||
|
self.hass, start, self._entity_id, no_attributes=True
|
||||||
|
)
|
||||||
last_state = last_state is not None and last_state in self._entity_states
|
last_state = last_state is not None and last_state in self._entity_states
|
||||||
last_time = start_timestamp
|
last_time = start_timestamp
|
||||||
elapsed = 0
|
elapsed = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user