mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Adhere to scan_interval in platforms when setup via config entry (#14969)
This commit is contained in:
committed by
Pascal Vizeli
parent
d6d685a483
commit
1128104281
@@ -373,13 +373,16 @@ class MockPlatform(object):
|
||||
# pylint: disable=invalid-name
|
||||
def __init__(self, setup_platform=None, dependencies=None,
|
||||
platform_schema=None, async_setup_platform=None,
|
||||
async_setup_entry=None):
|
||||
async_setup_entry=None, scan_interval=None):
|
||||
"""Initialize the platform."""
|
||||
self.DEPENDENCIES = dependencies or []
|
||||
|
||||
if platform_schema is not None:
|
||||
self.PLATFORM_SCHEMA = platform_schema
|
||||
|
||||
if scan_interval is not None:
|
||||
self.SCAN_INTERVAL = scan_interval
|
||||
|
||||
if setup_platform is not None:
|
||||
# We run this in executor, wrap it in function
|
||||
self.setup_platform = lambda *args: setup_platform(*args)
|
||||
|
||||
Reference in New Issue
Block a user