Fix typing on Context.user_id (#68019)

pull/68026/head
J. Nick Koston 2022-03-11 18:31:03 -10:00 committed by GitHub
parent 09944d936d
commit d3deae6288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -248,6 +248,7 @@ async def async_devices_disconnect(hass, data: RequestData, payload):
https://developers.google.com/assistant/smarthome/develop/process-intents#DISCONNECT
"""
assert data.context.user_id is not None
await data.config.async_disconnect_agent_user(data.context.user_id)
return None

View File

@ -701,7 +701,7 @@ class HomeAssistant:
class Context:
"""The context that triggered something."""
user_id: str = attr.ib(default=None)
user_id: str | None = attr.ib(default=None)
parent_id: str | None = attr.ib(default=None)
id: str = attr.ib(factory=uuid_util.random_uuid_hex)