Add example how to register API with HA (#2206)

This commit is contained in:
Paulus Schoutsen 2024-06-06 14:10:49 -04:00 committed by GitHub
parent 7abb5fb061
commit 199a48d5f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -267,6 +267,11 @@ class MyAPI(API):
llm_context=llm_context,
tools=[TimeTool()],
)
async def async_setup_api(hass: HomeAssistant) -> None:
"""Register the API with Home Assistant."""
llm.async_register_api(hass, MyAPI())
```
The `llm.API` class has the following attributes: