mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Add a guard against selecting all entities in state_changes_during_period
(#91585)
Add a guard against selecting all entities in state_changes_during_period This cannot happen in `dev` because we require entity ids
This commit is contained in:
parent
940861e2be
commit
03c517b066
@ -374,6 +374,8 @@ def state_changes_during_period(
|
||||
if entity_id:
|
||||
instance = recorder.get_instance(hass)
|
||||
metadata_id = instance.states_meta_manager.get(entity_id, session, False)
|
||||
if metadata_id is None:
|
||||
return {}
|
||||
entity_id_to_metadata_id = {entity_id: metadata_id}
|
||||
stmt = _state_changed_during_period_stmt(
|
||||
start_time,
|
||||
@ -394,7 +396,7 @@ def state_changes_during_period(
|
||||
states,
|
||||
start_time,
|
||||
entity_ids,
|
||||
entity_id_to_metadata_id,
|
||||
entity_id_to_metadata_id, # type: ignore[arg-type]
|
||||
include_start_time_state=include_start_time_state,
|
||||
),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user