hass-core/homeassistant/components/velux/scene.py
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00

31 lines
861 B
Python

"""Support for VELUX scenes."""
from homeassistant.components.scene import Scene
from . import _LOGGER, DATA_VELUX
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=None):
"""Set up the scenes for Velux platform."""
entities = []
for scene in hass.data[DATA_VELUX].pyvlx.scenes:
entities.append(VeluxScene(scene))
async_add_entities(entities)
class VeluxScene(Scene):
"""Representation of a Velux scene."""
def __init__(self, scene):
"""Init velux scene."""
_LOGGER.info("Adding Velux scene: %s", scene)
self.scene = scene
@property
def name(self):
"""Return the name of the scene."""
return self.scene.name
async def async_activate(self):
"""Activate the scene."""
await self.scene.run(wait_for_completion=False)