* Adding vera config entries support. * Fixing lint error. * Applying minimal changes necessary to get config entries working. * Addressing PR feedback by further reducing the scope of the change. * Addressing PR feedback. * Fixing pyvera import to make it easier to patch. Addressing PR feedback regarding creation of controller and scheduling of async config flow actions. * Updating code owners file. * Small fixes. * Adding a user config flow step. * Adding optional configs for user config flow. * Updating strings to be more clear to the user. * Adding options flow. Fixing some PR feedback. * Better handling of options. PR feedback changes. * Using config registry to update config options. * Better managing config from file or config from UI Disabling config through UI if config is provided from a file. More tests to account for these adjustments. * Address PR feedback. * Fixing test, merging with master. * Disabling all Vera UI for configs managed by configuration.yml. Adding more tests. * Updating config based on unique_id. Addressing additional PR feedback. * Rebasing off dev. Addressing feedback. * Addressing PR feedback.
27 lines
757 B
Python
27 lines
757 B
Python
"""Vera tests."""
|
|
from unittest.mock import MagicMock
|
|
|
|
import pyvera as pv
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .common import ComponentFactory, new_simple_controller_config
|
|
|
|
|
|
async def test_scene(
|
|
hass: HomeAssistant, vera_component_factory: ComponentFactory
|
|
) -> None:
|
|
"""Test function."""
|
|
vera_scene = MagicMock(spec=pv.VeraScene) # type: pv.VeraScene
|
|
vera_scene.scene_id = 1
|
|
vera_scene.name = "dev1"
|
|
entity_id = "scene.dev1_1"
|
|
|
|
await vera_component_factory.configure_component(
|
|
hass=hass, controller_config=new_simple_controller_config(scenes=(vera_scene,)),
|
|
)
|
|
|
|
await hass.services.async_call(
|
|
"scene", "turn_on", {"entity_id": entity_id},
|
|
)
|
|
await hass.async_block_till_done()
|