Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Fix for Home Assistant 2024.6.0 #15

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions custom_components/fallback_conversation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,16 @@ async def _async_process_agent(

return result

def _convert_agent_info_to_dict(self, agents: list[conversation.AgentInfo]) -> dict[str, str]:
def _convert_agent_info_to_dict(self, agents_info: list[conversation.AgentInfo]) -> dict[str, str]:
"""Takes a list of AgentInfo and makes it a dict of ID -> Name."""
r = {}
for agent in agents:
r[agent.id] = agent.name

return r

agent_manager = conversation.get_agent_manager(self.hass)

r = {}
for agent_info in agents_info:
agent = agent_manager.async_get_agent(agent_info.id)
agent_id = None
if hasattr(agent, "registry_entry"):
agent_id = agent.registry_entry.entity_id
r[agent_id] = agent_info.name
return r