From 3bfb6707e92f1d6b6a55dac72dbfb80afcac1c99 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Thu, 26 Dec 2024 09:27:20 -0800 Subject: [PATCH] Fix Nest ConfigEntry typing (#134021) --- homeassistant/components/nest/__init__.py | 5 ++--- homeassistant/components/nest/api.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/nest/__init__.py b/homeassistant/components/nest/__init__.py index 4349567b7f0..8adc0e4f714 100644 --- a/homeassistant/components/nest/__init__.py +++ b/homeassistant/components/nest/__init__.py @@ -27,7 +27,6 @@ from homeassistant.auth.permissions.const import POLICY_READ from homeassistant.components.camera import Image, img_util from homeassistant.components.http import KEY_HASS_USER from homeassistant.components.http.view import HomeAssistantView -from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( CONF_BINARY_SENSORS, CONF_CLIENT_ID, @@ -252,12 +251,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: NestConfigEntry) -> bool return True -async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: +async def async_unload_entry(hass: HomeAssistant, entry: NestConfigEntry) -> bool: """Unload a config entry.""" return await hass.config_entries.async_unload_platforms(entry, PLATFORMS) -async def async_remove_entry(hass: HomeAssistant, entry: ConfigEntry) -> None: +async def async_remove_entry(hass: HomeAssistant, entry: NestConfigEntry) -> None: """Handle removal of pubsub subscriptions created during config flow.""" if ( DATA_SDM not in entry.data diff --git a/homeassistant/components/nest/api.py b/homeassistant/components/nest/api.py index 5c65a70c75d..e86e326b1c2 100644 --- a/homeassistant/components/nest/api.py +++ b/homeassistant/components/nest/api.py @@ -12,7 +12,6 @@ from google_nest_sdm.admin_client import PUBSUB_API_HOST, AdminClient from google_nest_sdm.auth import AbstractAuth from google_nest_sdm.google_nest_subscriber import GoogleNestSubscriber -from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers import aiohttp_client, config_entry_oauth2_flow @@ -24,6 +23,7 @@ from .const import ( OAUTH2_TOKEN, SDM_SCOPES, ) +from .types import NestConfigEntry _LOGGER = logging.getLogger(__name__) @@ -102,7 +102,7 @@ class AccessTokenAuthImpl(AbstractAuth): async def new_subscriber( - hass: HomeAssistant, entry: ConfigEntry + hass: HomeAssistant, entry: NestConfigEntry ) -> GoogleNestSubscriber | None: """Create a GoogleNestSubscriber.""" implementation = (