mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Fix blue current mocking out platform with empty string (#153604)
Co-authored-by: Josef Zweck <josef@zweck.dev>
This commit is contained in:
@@ -120,7 +120,7 @@ def create_client_mock(
|
||||
async def init_integration(
|
||||
hass: HomeAssistant,
|
||||
config_entry: MockConfigEntry,
|
||||
platform="",
|
||||
platform: str | None = None,
|
||||
charge_point: dict | None = None,
|
||||
status: dict | None = None,
|
||||
grid: dict | None = None,
|
||||
@@ -136,6 +136,10 @@ async def init_integration(
|
||||
if grid is None:
|
||||
grid = {}
|
||||
|
||||
platforms = [platform] if platform else []
|
||||
if platform:
|
||||
platforms.append(platform)
|
||||
|
||||
future_container = FutureContainer(hass.loop.create_future())
|
||||
started_loop = Event()
|
||||
|
||||
@@ -144,7 +148,7 @@ async def init_integration(
|
||||
)
|
||||
|
||||
with (
|
||||
patch("homeassistant.components.blue_current.PLATFORMS", [platform]),
|
||||
patch("homeassistant.components.blue_current.PLATFORMS", platforms),
|
||||
patch("homeassistant.components.blue_current.Client", return_value=client_mock),
|
||||
):
|
||||
config_entry.add_to_hass(hass)
|
||||
|
||||
Reference in New Issue
Block a user