Revert custom component loading logic (#14327)
* Revert custom component loading logic * Lint * Fix tests * Guard for infinite inserts into sys.path
This commit is contained in:
1 parent
e60d066514
commit
5c95c53c6c
8 files changed
+84
-101
No files matched your search
@@ -3,9 +3,11 @@
|
||||
from homeassistant.components.image_processing import ImageProcessingEntity
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
async def async_setup_platform(hass, config, async_add_devices_callback,
|
||||
discovery_info=None):
|
||||
"""Set up the test image_processing platform."""
|
||||
add_devices([TestImageProcessing('camera.demo_camera', "Test")])
|
||||
async_add_devices_callback([
|
||||
TestImageProcessing('camera.demo_camera', "Test")])
|
||||
|
||||
|
||||
class TestImageProcessing(ImageProcessingEntity):
|
||||
|
||||
@@ -21,6 +21,7 @@ def init(empty=False):
|
||||
]
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||
async def async_setup_platform(hass, config, async_add_devices_callback,
|
||||
discovery_info=None):
|
||||
"""Return mock devices."""
|
||||
add_devices_callback(DEVICES)
|
||||
async_add_devices_callback(DEVICES)
|
||||
@@ -21,6 +21,7 @@ def init(empty=False):
|
||||
]
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||
async def async_setup_platform(hass, config, async_add_devices_callback,
|
||||
discovery_info=None):
|
||||
"""Find and return test switches."""
|
||||
add_devices_callback(DEVICES)
|
||||
async_add_devices_callback(DEVICES)
|
||||
@@ -1,4 +1,7 @@
|
||||
"""Provide a mock package component."""
|
||||
from .const import TEST # noqa
|
||||
|
||||
|
||||
DOMAIN = 'test_package'
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
"""Constants for test_package custom component."""
|
||||
TEST = 5
|
||||
Reference in new issue
Block a user