22
33from collections .abc import AsyncGenerator , Generator
44import time
5+ from typing import Any
56from unittest .mock import AsyncMock , MagicMock , patch
67
7- from pymiele import MieleAction , MieleDevices
88import pytest
99
1010from homeassistant .components .application_credentials import (
1414from homeassistant .components .miele .const import DOMAIN
1515from homeassistant .core import HomeAssistant
1616from homeassistant .setup import async_setup_component
17+ from homeassistant .util .json import JsonValueType
1718
1819from . import get_actions_callback , get_data_callback
1920from .const import CLIENT_ID , CLIENT_SECRET
@@ -79,7 +80,7 @@ def load_device_file() -> str:
7980
8081
8182@pytest .fixture
82- async def device_fixture (hass : HomeAssistant , load_device_file : str ) -> MieleDevices :
83+ async def device_fixture (hass : HomeAssistant , load_device_file : str ) -> dict [ str , Any ] :
8384 """Fixture for device."""
8485 return await async_load_json_object_fixture (hass , load_device_file , DOMAIN )
8586
@@ -91,7 +92,7 @@ def load_action_file() -> str:
9192
9293
9394@pytest .fixture
94- async def action_fixture (hass : HomeAssistant , load_action_file : str ) -> MieleAction :
95+ async def action_fixture (hass : HomeAssistant , load_action_file : str ) -> dict [ str , Any ] :
9596 """Fixture for action."""
9697 return await async_load_json_object_fixture (hass , load_action_file , DOMAIN )
9798
@@ -103,7 +104,9 @@ def load_programs_file() -> str:
103104
104105
105106@pytest .fixture
106- async def programs_fixture (hass : HomeAssistant , load_programs_file : str ) -> list [dict ]:
107+ async def programs_fixture (
108+ hass : HomeAssistant , load_programs_file : str
109+ ) -> JsonValueType :
107110 """Fixture for available programs."""
108111 return load_json_value_fixture (load_programs_file , DOMAIN )
109112
@@ -141,7 +144,7 @@ async def setup_platform(
141144 hass : HomeAssistant ,
142145 mock_config_entry : MockConfigEntry ,
143146 platforms ,
144- ) -> AsyncGenerator [None ]:
147+ ) -> AsyncGenerator [MockConfigEntry ]:
145148 """Set up one or all platforms."""
146149
147150 with patch (f"homeassistant.components.{ DOMAIN } .PLATFORMS" , platforms ):
@@ -169,7 +172,7 @@ def mock_setup_entry() -> Generator[AsyncMock]:
169172async def push_data_and_actions (
170173 hass : HomeAssistant ,
171174 mock_miele_client : MagicMock ,
172- device_fixture : MieleDevices ,
175+ device_fixture : dict [ str , Any ] ,
173176) -> None :
174177 """Fixture to push data and actions through mock."""
175178
0 commit comments