diff --git a/homeassistant/components/smartthings/smartapp.py b/homeassistant/components/smartthings/smartapp.py index e2593dd7b10..6b0da00b132 100644 --- a/homeassistant/components/smartthings/smartapp.py +++ b/homeassistant/components/smartthings/smartapp.py @@ -16,6 +16,7 @@ from pysmartthings import ( CAPABILITIES, CLASSIFICATION_AUTOMATION, App, + AppEntity, AppOAuth, AppSettings, InstalledAppStatus, @@ -63,7 +64,7 @@ def format_unique_id(app_id: str, location_id: str) -> str: return f"{app_id}_{location_id}" -async def find_app(hass: HomeAssistant, api): +async def find_app(hass: HomeAssistant, api: SmartThings) -> AppEntity | None: """Find an existing SmartApp for this installation of hass.""" apps = await api.apps() for app in [app for app in apps if app.app_name.startswith(APP_NAME_PREFIX)]: @@ -74,6 +75,7 @@ async def find_app(hass: HomeAssistant, api): == hass.data[DOMAIN][CONF_INSTANCE_ID] ): return app + return None async def validate_installed_app(api, installed_app_id: str):