hass-core/homeassistant/components/scene/fibaro.py
pbalogh77 7dac7b9e5e Support for multiple Fibaro gateways (#19705)
* Preparing for transition to config flow

Added multiple gateway support
Reworked parameter flow to platforms to enable multiple controllers
Breaking change to config, now a list of gateways is expected instead of a single config

* Updated coveragerc

Added new location of fibaro component

* Fixes based on code review and extended logging

Addressed issues raised by code review
Added extended debug logging to get better reports from users if the device type mapping is not perfect

* Changhes based on code review

Changes to how configuration is read and schemas
Fix to device type mapping logic

* simplified reading config

* oops

oops

* grr

grr

* change based on code review

* changes based on code review

changes based on code review
2019-01-11 15:29:54 -08:00

35 lines
898 B
Python

"""
Support for Fibaro scenes.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/scene.fibaro/
"""
import logging
from homeassistant.components.scene import (
Scene)
from homeassistant.components.fibaro import (
FIBARO_DEVICES, FibaroDevice)
DEPENDENCIES = ['fibaro']
_LOGGER = logging.getLogger(__name__)
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(
[FibaroScene(scene)
for scene in hass.data[FIBARO_DEVICES]['scene']], True)
class FibaroScene(FibaroDevice, Scene):
"""Representation of a Fibaro scene entity."""
def activate(self):
"""Activate the scene."""
self.fibaro_device.start()