1
0
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:
Joakim Plate
2025-10-04 15:17:56 +02:00
committed by GitHub
parent 44d9eaea95
commit c3fcd34d4c

View File

@@ -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)