Remove conversation from mypy ignore list (#74991)

This commit is contained in:
epenet 2022-07-11 17:47:33 +02:00 committed by GitHub
parent 63706d2f67
commit 7e0515b119
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 13 deletions

View File

@ -80,10 +80,10 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
return True
@websocket_api.async_response
@websocket_api.websocket_command(
{"type": "conversation/process", "text": str, vol.Optional("conversation_id"): str}
)
@websocket_api.async_response
async def websocket_process(hass, connection, msg):
"""Process text."""
connection.send_result(
@ -94,8 +94,8 @@ async def websocket_process(hass, connection, msg):
)
@websocket_api.async_response
@websocket_api.websocket_command({"type": "conversation/agent/info"})
@websocket_api.async_response
async def websocket_get_agent_info(hass, connection, msg):
"""Do we need onboarding."""
agent = await _get_agent(hass)
@ -109,8 +109,8 @@ async def websocket_get_agent_info(hass, connection, msg):
)
@websocket_api.async_response
@websocket_api.websocket_command({"type": "conversation/onboarding/set", "shown": bool})
@websocket_api.async_response
async def websocket_set_onboarding(hass, connection, msg):
"""Set onboarding status."""
agent = await _get_agent(hass)

View File

@ -26,5 +26,5 @@ class AbstractConversationAgent(ABC):
@abstractmethod
async def async_process(
self, text: str, context: Context, conversation_id: str | None = None
) -> intent.IntentResponse:
) -> intent.IntentResponse | None:
"""Process a sentence."""

View File

@ -112,7 +112,7 @@ class DefaultAgent(AbstractConversationAgent):
async def async_process(
self, text: str, context: core.Context, conversation_id: str | None = None
) -> intent.IntentResponse:
) -> intent.IntentResponse | None:
"""Process a sentence."""
intents = self.hass.data[DOMAIN]
@ -129,3 +129,5 @@ class DefaultAgent(AbstractConversationAgent):
text,
context,
)
return None

View File

@ -2662,12 +2662,6 @@ ignore_errors = true
[mypy-homeassistant.components.cloud.http_api]
ignore_errors = true
[mypy-homeassistant.components.conversation]
ignore_errors = true
[mypy-homeassistant.components.conversation.default_agent]
ignore_errors = true
[mypy-homeassistant.components.evohome]
ignore_errors = true

View File

@ -18,8 +18,6 @@ from .model import Config, Integration
IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.cloud.client",
"homeassistant.components.cloud.http_api",
"homeassistant.components.conversation",
"homeassistant.components.conversation.default_agent",
"homeassistant.components.evohome",
"homeassistant.components.evohome.climate",
"homeassistant.components.lovelace",