Skip to content

Commit

Permalink
Remove check_files
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Jul 22, 2024
1 parent 2a92cf3 commit fb43d70
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions custom_components/healthchecksio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ async def async_setup_entry(
hass: core.HomeAssistant, config_entry: config_entries.ConfigEntry
) -> bool:
"""Set up this integration using UI."""
# Check that all required files are present
file_check = await check_files(hass)
if not file_check:
return False

# Create DATA dict
if DOMAIN_DATA not in hass.data:
hass.data[DOMAIN_DATA] = {}
Expand Down Expand Up @@ -119,22 +114,3 @@ async def update_data(self):
await session.get(check_url)
except Exception: # pylint: disable=broad-except
LOGGER.exception("Could not update data")


async def check_files(hass: core.HomeAssistant) -> bool:
"""Return bool that indicates if all files are present."""
# Verify that the user downloaded all files.
base = f"{hass.config.path()}/custom_components/{DOMAIN}/"
missing = []
for file in REQUIRED_FILES:
fullpath = f"{base}{file}"
if not os.path.exists(fullpath):
missing.append(file)

if missing:
LOGGER.critical("The following files are missing: %s", missing)
returnvalue = False
else:
returnvalue = True

return returnvalue

0 comments on commit fb43d70

Please sign in to comment.