diff --git a/homeassistant/helpers/entity_platform.py b/homeassistant/helpers/entity_platform.py index 717917f816d..0a7667e64d5 100644 --- a/homeassistant/helpers/entity_platform.py +++ b/homeassistant/helpers/entity_platform.py @@ -25,6 +25,7 @@ SLOW_SETUP_WARNING = 10 SLOW_SETUP_MAX_WAIT = 60 PLATFORM_NOT_READY_RETRIES = 10 DATA_ENTITY_PLATFORM = "entity_platform" +PLATFORM_NOT_READY_BASE_WAIT_TIME = 30 # seconds class EntityPlatform: @@ -189,7 +190,7 @@ class EntityPlatform: return True except PlatformNotReady: tries += 1 - wait_time = min(tries, 6) * 30 + wait_time = min(tries, 6) * PLATFORM_NOT_READY_BASE_WAIT_TIME logger.warning( "Platform %s not ready yet. Retrying in %d seconds.", self.platform_name, diff --git a/tests/components/influxdb/test_sensor.py b/tests/components/influxdb/test_sensor.py index c75c7d35578..2247559a486 100644 --- a/tests/components/influxdb/test_sensor.py +++ b/tests/components/influxdb/test_sensor.py @@ -18,6 +18,7 @@ from homeassistant.components.influxdb.const import ( from homeassistant.components.influxdb.sensor import PLATFORM_SCHEMA import homeassistant.components.sensor as sensor from homeassistant.const import STATE_UNKNOWN +from homeassistant.helpers.entity_platform import PLATFORM_NOT_READY_BASE_WAIT_TIME from homeassistant.setup import async_setup_component from homeassistant.util import dt as dt_util @@ -27,7 +28,6 @@ from tests.common import async_fire_time_changed INFLUXDB_PATH = "homeassistant.components.influxdb" INFLUXDB_CLIENT_PATH = f"{INFLUXDB_PATH}.InfluxDBClient" INFLUXDB_SENSOR_PATH = f"{INFLUXDB_PATH}.sensor" -PLATFORM_NOT_READY_BASE_WAIT_TIME = 30 BASE_V1_CONFIG = {} BASE_V2_CONFIG = {