Limit scope to only climate entities on Midea tests (#177902)

This commit is contained in:
Lucas Mindêllo de Andrade
2026-08-01 00:36:39 +02:00
committed by GitHub
parent e0ed494342
commit 2f634ad6fd
+5 -3
View File
@@ -2,6 +2,7 @@
from collections.abc import Callable
from typing import Any
from unittest.mock import patch
from midealocal.const import DeviceType
from midealocal.devices.ac import DeviceAttributes as ACAttributes
@@ -44,7 +45,7 @@ from homeassistant.components.climate import (
HVACMode,
)
from homeassistant.components.midea.climate import FAN_FULL_SPEED, FAN_SILENT
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.const import ATTR_ENTITY_ID, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers import entity_registry as er
@@ -1460,6 +1461,7 @@ async def test_climate_state_snapshot(
) -> None:
"""Test async_setup_entry creates entities for each device type."""
config_entry = mock_config_entry(device)
await setup_integration(hass, config_entry, device)
with patch("homeassistant.components.midea._PLATFORMS", [Platform.CLIMATE]):
await setup_integration(hass, config_entry, device)
await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)
await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)