From f3c6558db4d834dd3c26b159b2382641810defe9 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 20 Feb 2023 03:27:30 +0100 Subject: [PATCH] Improve conversation typing (#88440) --- homeassistant/components/conversation/default_agent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/conversation/default_agent.py b/homeassistant/components/conversation/default_agent.py index b418275f857..13dec808bea 100644 --- a/homeassistant/components/conversation/default_agent.py +++ b/homeassistant/components/conversation/default_agent.py @@ -3,7 +3,7 @@ from __future__ import annotations import asyncio from collections import defaultdict -from collections.abc import Iterable, Mapping +from collections.abc import Iterable from dataclasses import dataclass import logging from pathlib import Path @@ -83,7 +83,7 @@ class DefaultAgent(AbstractConversationAgent): # intent -> [sentences] self._config_intents: dict[str, Any] = {} - self._slot_lists: dict[str, TextSlotList] | None = None + self._slot_lists: dict[str, SlotList] | None = None async def async_initialize(self, config_intents): """Initialize the default agent.""" @@ -133,7 +133,7 @@ class DefaultAgent(AbstractConversationAgent): conversation_id, ) - slot_lists: Mapping[str, SlotList] = self._make_slot_lists() + slot_lists = self._make_slot_lists() result = await self.hass.async_add_executor_job( self._recognize, @@ -437,7 +437,7 @@ class DefaultAgent(AbstractConversationAgent): return self._slot_lists = None - def _make_slot_lists(self) -> Mapping[str, SlotList]: + def _make_slot_lists(self) -> dict[str, SlotList]: """Create slot lists with areas and entity names/aliases.""" if self._slot_lists is not None: return self._slot_lists