diff --git a/Makefile b/Makefile index aa56174d..625cd5b7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -__VERSION__ = "3.6.17" +__VERSION__ = "3.6.18" bump: bump2version --allow-dirty --current-version $(__VERSION__) patch Makefile custom_components/spotcast/manifest.json diff --git a/custom_components/spotcast/__init__.py b/custom_components/spotcast/__init__.py index 5a997263..a55786e1 100644 --- a/custom_components/spotcast/__init__.py +++ b/custom_components/spotcast/__init__.py @@ -42,6 +42,12 @@ def setup(hass, config): + + # get spotify core integration status + if not helpers.get_spotify_install_status(hass): + _LOGGER.error("Spotify integration was not found, aborting setup...") + return False + """Setup the Spotcast service.""" conf = config[DOMAIN] diff --git a/custom_components/spotcast/helpers.py b/custom_components/spotcast/helpers.py index 438b9fdc..b66f5bdc 100644 --- a/custom_components/spotcast/helpers.py +++ b/custom_components/spotcast/helpers.py @@ -36,6 +36,19 @@ def get_spotify_devices(hass, spotify_user_id): _LOGGER.debug("get_spotify_devices: %s", resp) return resp +def get_spotify_install_status(hass): + + platform_string = "spotify" + platforms = entity_platform.async_get_platforms(hass, platform_string) + platform_count = len(platforms) + + if platform_count == 0: + _LOGGER.error("%s integration not found", platform_string) + else: + _LOGGER.debug("%s integration found", platform_string) + + return platform_count != 0 + def get_cast_devices(hass): platforms = entity_platform.async_get_platforms(hass, "cast") diff --git a/custom_components/spotcast/manifest.json b/custom_components/spotcast/manifest.json index d16dbe66..36ba4913 100644 --- a/custom_components/spotcast/manifest.json +++ b/custom_components/spotcast/manifest.json @@ -7,7 +7,7 @@ "requirements": [ "spotify_token==1.0.0" ], - "version": "v3.6.17", + "version": "v3.6.18", "dependencies": [ "spotify" ], diff --git a/setup.cfg b/setup.cfg index 30d77cf2..56cda372 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.6.17 +current_version = 3.6.18 [flake8] exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build