Skip to content

Commit

Permalink
Tweak check for custom_updater custom integration
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed Apr 8, 2024
1 parent a422090 commit ab32192
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions custom_components/hacs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,18 @@ async def async_startup():
"""HACS startup tasks."""
hacs.enable_hacs()

for location in (
hass.config.path("custom_components/custom_updater.py"),
hass.config.path("custom_components/custom_updater/__init__.py"),
):
if os.path.exists(location):
hacs.log.critical(
"This cannot be used with custom_updater. "
"To use this you need to remove custom_updater form %s",
location,
)

hacs.disable_hacs(HacsDisabledReason.CONSTRAINS)
return False
try:
import custom_components.custom_updater
except ImportError:
pass
else:
hacs.log.critical(
"This cannot be used with custom_updater. "
"To use this you need to remove custom_updater from `custom_components`",
)

hacs.disable_hacs(HacsDisabledReason.CONSTRAINS)
return False

if not version_left_higher_or_equal_then_right(
hacs.core.ha_version.string,
Expand Down

0 comments on commit ab32192

Please sign in to comment.