Move yaml configuration to integration key for command_line (#92824)
* Inital init commit * bs and cover * notify * sensor * switch * Issues * Finalize __init__ * First pass tests * Fix Binary sensors * Test cover * Test notify * Test sensor * Tests switch * Fix coverage * Add codeowner * Fix caplog * test issue * Flaky test notify * Fix async * Adjust yaml structure * Change yaml format again * Issue strings * Fix tests * string review comment
This commit is contained in:
parent
20d1a0fc77
commit
46e7486ce6
16 changed files with 1461 additions and 489 deletions
27
tests/components/command_line/test_init.py
Normal file
27
tests/components/command_line/test_init.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
"""Test Command line component setup process."""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import timedelta
|
||||
|
||||
from homeassistant.const import STATE_ON, STATE_OPEN
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
|
||||
|
||||
async def test_setup_config(hass: HomeAssistant, load_yaml_integration: None) -> None:
|
||||
"""Test setup from yaml."""
|
||||
|
||||
async_fire_time_changed(hass, dt_util.utcnow() + timedelta(minutes=10))
|
||||
await hass.async_block_till_done()
|
||||
|
||||
state_binary_sensor = hass.states.get("binary_sensor.test")
|
||||
state_sensor = hass.states.get("sensor.test")
|
||||
state_cover = hass.states.get("cover.test")
|
||||
state_switch = hass.states.get("switch.test")
|
||||
|
||||
assert state_binary_sensor.state == STATE_ON
|
||||
assert state_sensor.state == "5"
|
||||
assert state_cover.state == STATE_OPEN
|
||||
assert state_switch.state == STATE_ON
|
Loading…
Add table
Add a link
Reference in a new issue