1
mirror of https://github.com/home-assistant/core synced 2024-09-12 15:16:21 +02:00
ha-core/homeassistant/components/fibaro/scene.py

25 lines
656 B
Python
Raw Normal View History

"""Support for Fibaro scenes."""
from typing import Any
from homeassistant.components.scene import Scene
from . import FIBARO_DEVICES, FibaroDevice
2019-07-31 21:25:30 +02:00
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Perform the setup for Fibaro scenes."""
if discovery_info is None:
return
async_add_entities(
2019-07-31 21:25:30 +02:00
[FibaroScene(scene) for scene in hass.data[FIBARO_DEVICES]["scene"]], True
)
class FibaroScene(FibaroDevice, Scene):
"""Representation of a Fibaro scene entity."""
def activate(self, **kwargs: Any) -> None:
"""Activate the scene."""
self.fibaro_device.start()