From 1622d3081c4967d66ac991449a13cdd0cd8d56e0 Mon Sep 17 00:00:00 2001 From: MrD3y5eL Date: Sat, 18 Jan 2025 20:42:54 +1000 Subject: [PATCH] Add config schema to satisfy hassfest requirements --- custom_components/unifi_site_manager/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/custom_components/unifi_site_manager/__init__.py b/custom_components/unifi_site_manager/__init__.py index 9c6bcef..597c017 100755 --- a/custom_components/unifi_site_manager/__init__.py +++ b/custom_components/unifi_site_manager/__init__.py @@ -2,12 +2,12 @@ from __future__ import annotations import logging -from typing import Any from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_API_KEY, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.aiohttp_client import async_get_clientsession from .api import ( @@ -19,12 +19,16 @@ from .coordinator import UnifiSiteManagerDataUpdateCoordinator from .services import async_setup_services, async_unload_services +_LOGGER = logging.getLogger(__name__) + PLATFORMS: list[Platform] = [ Platform.BINARY_SENSOR, Platform.SENSOR, ] -_LOGGER = logging.getLogger(__name__) +# Add config schema to satisfy hassfest +CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) + async def async_setup(hass: HomeAssistant, config: dict) -> bool: """Set up the UniFi Site Manager component.""" @@ -35,6 +39,7 @@ async def async_setup(hass: HomeAssistant, config: dict) -> bool: return True + async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up UniFi Site Manager from a config entry.""" # Ensure domain data is initialized