hass-core/tests/components/switch/test_light.py
Erik Montnemery cb7e492e81
Add switch_as_x integration (#67878)
* Add switch_as_x integration

* Address review comments

* Add translation strings

* Rename entity_type option to target_domain

* Move LightSwitch class definition to switch_as_x/light.py

* Update manifest

* Move tests
2022-03-10 12:23:01 +01:00

38 lines
925 B
Python

"""The tests for the Light Switch platform."""
from homeassistant.setup import async_setup_component
async def test_default_state(hass):
"""Test light switch yaml config."""
await async_setup_component(
hass,
"light",
{
"light": {
"platform": "switch",
"entity_id": "switch.test",
"name": "Christmas Tree Lights",
}
},
)
await hass.async_block_till_done()
assert hass.states.get("light.christmas_tree_lights")
async def test_default_state_no_name(hass):
"""Test light switch default name."""
await async_setup_component(
hass,
"light",
{
"light": {
"platform": "switch",
"entity_id": "switch.test",
}
},
)
await hass.async_block_till_done()
assert hass.states.get("light.light_switch")