Fix dev branch (#22493)
This commit is contained in:
1 parent
4db224ceb5
commit
8d86722c0e
4 files changed
+16
-5
No files matched your search
@@ -1,6 +1,5 @@
|
||||
"""Support for Homekit device discovery."""
|
||||
import logging
|
||||
import os
|
||||
|
||||
from homeassistant.components.discovery import SERVICE_HOMEKIT
|
||||
from homeassistant.helpers import discovery
|
||||
@@ -9,7 +8,7 @@ from homeassistant.helpers.entity import Entity
|
||||
from .config_flow import load_old_pairings
|
||||
from .connection import get_accessory_information, HKDevice
|
||||
from .const import (
|
||||
CONTROLLER, HOMEKIT_DIR, KNOWN_DEVICES, PAIRING_FILE
|
||||
CONTROLLER, KNOWN_DEVICES
|
||||
)
|
||||
from .const import DOMAIN # noqa: pylint: disable=unused-import
|
||||
|
||||
|
||||
+13
-1
@@ -83,7 +83,11 @@ def get_platform(hass, # type: HomeAssistant
|
||||
"""
|
||||
# If the platform has a component, we will limit the platform loading path
|
||||
# to be the same source (custom/built-in).
|
||||
component = _load_file(hass, platform_name, LOOKUP_PATHS)
|
||||
if domain not in ['automation', 'mqtt', 'telegram_bot']:
|
||||
component = _load_file(hass, platform_name, LOOKUP_PATHS)
|
||||
else:
|
||||
# avoid load component for legacy platform
|
||||
component = None
|
||||
|
||||
# Until we have moved all platforms under their component/own folder, it
|
||||
# can be that the component is None.
|
||||
@@ -99,6 +103,14 @@ def get_platform(hass, # type: HomeAssistant
|
||||
if platform is not None:
|
||||
return platform
|
||||
|
||||
# Legacy platform check for automation: components/automation/event.py
|
||||
if component is None and domain in ['automation', 'mqtt', 'telegram_bot']:
|
||||
platform = _load_file(
|
||||
hass,
|
||||
PLATFORM_FORMAT.format(domain=platform_name, platform=domain),
|
||||
base_paths
|
||||
)
|
||||
|
||||
# Legacy platform check for custom: custom_components/light/hue.py
|
||||
# Only check if the component was also in custom components.
|
||||
if component is None or base_paths[0] == PACKAGE_CUSTOM_COMPONENTS:
|
||||
|
||||
Reference in new issue
Block a user