mirror of
https://github.com/home-assistant/core.git
synced 2025-05-06 23:19:18 +00:00

* Remove dependencies and requirements * Revert "Remove dependencies and requirements" This reverts commit fe7171b4cd30889bad5adc9a4fd60059d05ba5a7. * Remove dependencies and requirements * Revert "Remove dependencies and requirements" This reverts commit 391355ee2cc53cbe6954f940062b18ae34b05621. * Remove dependencies and requirements * Fix flake8 complaints * Fix more flake8 complaints * Revert non-component removals
36 lines
995 B
Python
36 lines
995 B
Python
"""Support for Wink scenes."""
|
|
import logging
|
|
|
|
from homeassistant.components.scene import Scene
|
|
|
|
from . import DOMAIN, WinkDevice
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
|
"""Set up the Wink platform."""
|
|
import pywink
|
|
|
|
for scene in pywink.get_scenes():
|
|
_id = scene.object_id() + scene.name()
|
|
if _id not in hass.data[DOMAIN]['unique_ids']:
|
|
add_entities([WinkScene(scene, hass)])
|
|
|
|
|
|
class WinkScene(WinkDevice, Scene):
|
|
"""Representation of a Wink shortcut/scene."""
|
|
|
|
def __init__(self, wink, hass):
|
|
"""Initialize the Wink device."""
|
|
super().__init__(wink, hass)
|
|
hass.data[DOMAIN]['entities']['scene'].append(self)
|
|
|
|
async def async_added_to_hass(self):
|
|
"""Call when entity is added to hass."""
|
|
self.hass.data[DOMAIN]['entities']['scene'].append(self)
|
|
|
|
def activate(self):
|
|
"""Activate the scene."""
|
|
self.wink.activate()
|