mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Change HomeAssistantType to HomeAssistant (#49522)
This commit is contained in:
@@ -15,15 +15,13 @@ from homeassistant.const import (
|
||||
SERVICE_RELOAD,
|
||||
SERVICE_STOP_COVER,
|
||||
)
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
|
||||
|
||||
async def setup_test_entity(
|
||||
hass: HomeAssistantType, config_dict: dict[str, Any]
|
||||
) -> None:
|
||||
async def setup_test_entity(hass: HomeAssistant, config_dict: dict[str, Any]) -> None:
|
||||
"""Set up a test command line notify service."""
|
||||
assert await setup.async_setup_component(
|
||||
hass,
|
||||
@@ -37,7 +35,7 @@ async def setup_test_entity(
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
async def test_no_covers(caplog: Any, hass: HomeAssistantType) -> None:
|
||||
async def test_no_covers(caplog: Any, hass: HomeAssistant) -> None:
|
||||
"""Test that the cover does not polls when there's no state command."""
|
||||
|
||||
with patch(
|
||||
@@ -48,7 +46,7 @@ async def test_no_covers(caplog: Any, hass: HomeAssistantType) -> None:
|
||||
assert "No covers added" in caplog.text
|
||||
|
||||
|
||||
async def test_no_poll_when_cover_has_no_command_state(hass: HomeAssistantType) -> None:
|
||||
async def test_no_poll_when_cover_has_no_command_state(hass: HomeAssistant) -> None:
|
||||
"""Test that the cover does not polls when there's no state command."""
|
||||
|
||||
with patch(
|
||||
@@ -61,7 +59,7 @@ async def test_no_poll_when_cover_has_no_command_state(hass: HomeAssistantType)
|
||||
assert not check_output.called
|
||||
|
||||
|
||||
async def test_poll_when_cover_has_command_state(hass: HomeAssistantType) -> None:
|
||||
async def test_poll_when_cover_has_command_state(hass: HomeAssistant) -> None:
|
||||
"""Test that the cover polls when there's a state command."""
|
||||
|
||||
with patch(
|
||||
@@ -76,7 +74,7 @@ async def test_poll_when_cover_has_command_state(hass: HomeAssistantType) -> Non
|
||||
)
|
||||
|
||||
|
||||
async def test_state_value(hass: HomeAssistantType) -> None:
|
||||
async def test_state_value(hass: HomeAssistant) -> None:
|
||||
"""Test with state value."""
|
||||
with tempfile.TemporaryDirectory() as tempdirname:
|
||||
path = os.path.join(tempdirname, "cover_status")
|
||||
@@ -119,7 +117,7 @@ async def test_state_value(hass: HomeAssistantType) -> None:
|
||||
assert entity_state.state == "closed"
|
||||
|
||||
|
||||
async def test_reload(hass: HomeAssistantType) -> None:
|
||||
async def test_reload(hass: HomeAssistant) -> None:
|
||||
"""Verify we can reload command_line covers."""
|
||||
|
||||
await setup_test_entity(
|
||||
@@ -155,7 +153,7 @@ async def test_reload(hass: HomeAssistantType) -> None:
|
||||
assert hass.states.get("cover.from_yaml")
|
||||
|
||||
|
||||
async def test_move_cover_failure(caplog: Any, hass: HomeAssistantType) -> None:
|
||||
async def test_move_cover_failure(caplog: Any, hass: HomeAssistant) -> None:
|
||||
"""Test with state value."""
|
||||
|
||||
await setup_test_entity(
|
||||
|
||||
Reference in New Issue
Block a user