ZigBee: Ensure correct entity types are used for each component.

This commit is contained in:
Flyte 2016-01-29 12:00:53 +00:00
parent 241a768983
commit c17a4fca80
5 changed files with 48 additions and 13 deletions

View file

@ -3,6 +3,8 @@ homeassistant.components.switch.zigbee
Contains functionality to use a ZigBee device as a switch.
"""
from homeassistant.components.switch import SwitchDevice
from homeassistant.components.zigbee import (
ZigBeeDigitalOut, ZigBeeDigitalOutConfig)
@ -15,5 +17,12 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
Create and add an entity based on the configuration.
"""
add_entities([
ZigBeeDigitalOut(hass, ZigBeeDigitalOutConfig(config))
ZigBeeSwitch(hass, ZigBeeDigitalOutConfig(config))
])
class ZigBeeSwitch(ZigBeeDigitalOut, SwitchDevice):
"""
Use multiple inheritance to turn a ZigBeeDigitalOut into a SwitchDevice.
"""
pass