core/homeassistant/components/switch/zigbee.py

29 lines
670 B
Python
Raw Normal View History

2016-01-24 08:02:14 +00:00
"""
homeassistant.components.switch.zigbee
Contains functionality to use a ZigBee device as a switch.
"""
from homeassistant.components.switch import SwitchDevice
2016-01-24 08:02:14 +00:00
from homeassistant.components.zigbee import (
ZigBeeDigitalOut, ZigBeeDigitalOutConfig)
DEPENDENCIES = ["zigbee"]
def setup_platform(hass, config, add_entities, discovery_info=None):
"""
Create and add an entity based on the configuration.
"""
add_entities([
ZigBeeSwitch(hass, ZigBeeDigitalOutConfig(config))
2016-01-24 08:02:14 +00:00
])
class ZigBeeSwitch(ZigBeeDigitalOut, SwitchDevice):
"""
Use multiple inheritance to turn a ZigBeeDigitalOut into a SwitchDevice.
"""
pass