From 0f8785d8bc13e2d26769847ef45a418567b594e0 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Fri, 17 Jan 2025 08:44:40 +0100 Subject: [PATCH] Ensure entity platform in alert tests (#135714) --- tests/components/alert/test_init.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/components/alert/test_init.py b/tests/components/alert/test_init.py index 263fb69c883..27997a093e5 100644 --- a/tests/components/alert/test_init.py +++ b/tests/components/alert/test_init.py @@ -30,7 +30,7 @@ from homeassistant.const import ( from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.setup import async_setup_component -from tests.common import async_mock_service +from tests.common import MockEntityPlatform, async_mock_service NAME = "alert_test" DONE_MESSAGE = "alert_gone" @@ -338,6 +338,7 @@ async def test_skipfirst(hass: HomeAssistant, mock_notifier: list[ServiceCall]) async def test_done_message_state_tracker_reset_on_cancel(hass: HomeAssistant) -> None: """Test that the done message is reset when canceled.""" entity = alert.AlertEntity(hass, *TEST_NOACK) + entity.platform = MockEntityPlatform(hass) entity._cancel = lambda *args: None assert entity._send_done_message is False entity._send_done_message = True