2022-12-01 19:44:56 +00:00
|
|
|
"""Provide add-on management."""
|
2024-03-08 14:01:29 +00:00
|
|
|
|
2022-12-01 19:44:56 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from homeassistant.components.hassio import AddonManager
|
|
|
|
from homeassistant.core import HomeAssistant, callback
|
|
|
|
from homeassistant.helpers.singleton import singleton
|
|
|
|
|
|
|
|
from .const import ADDON_SLUG, DOMAIN, LOGGER
|
|
|
|
|
|
|
|
DATA_ADDON_MANAGER = f"{DOMAIN}_addon_manager"
|
|
|
|
|
|
|
|
|
|
|
|
@singleton(DATA_ADDON_MANAGER)
|
|
|
|
@callback
|
|
|
|
def get_addon_manager(hass: HomeAssistant) -> AddonManager:
|
|
|
|
"""Get the add-on manager."""
|
|
|
|
return AddonManager(hass, LOGGER, "Matter Server", ADDON_SLUG)
|