Fix implicit-return in smartthings (#122927)

This commit is contained in:
epenet 2024-07-31 20:49:06 +02:00 committed by GitHub
parent 9023d80d1b
commit b8ac86939b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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):