Added not dimming Insteon devices on an ISY controller as switches.

This commit is contained in:
Ryan Kraus committed 2015-04-12 17:18:14 -04:00
1 parent f6d75f2db2
commit 4e3ccfffbb
3 files changed
+48 -7

No files matched your search

+2 -1
View File
@@ -10,7 +10,7 @@ from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.const import (
STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID)
from homeassistant.components import group, discovery, wink
from homeassistant.components import group, discovery, wink, isy994
DOMAIN = 'switch'
DEPENDENCIES = []
@@ -30,6 +30,7 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
DISCOVERY_PLATFORMS = {
discovery.services.BELKIN_WEMO: 'wemo',
wink.DISCOVER_SWITCHES: 'wink',
isy994.DISCOVER_SWITCHES: 'isy994',
}
_LOGGER = logging.getLogger(__name__)
+33
View File
@@ -0,0 +1,33 @@
""" Support for ISY994 lights. """
# system imports
import logging
# homeassistant imports
from homeassistant.components.isy994 import ISY, ISYDeviceABC
from homeassistant.const import STATE_ON, STATE_OFF
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the isy994 platform. """
logger = logging.getLogger(__name__)
devs = []
# verify connection
if ISY is None or not ISY.connected:
logger.error('A connection has not been made to the ISY controller.')
return False
# import not dimmable nodes and groups
for node in ISY.nodes:
if not node.dimmable:
devs.append(ISYSwitchDevice(node))
# import ISY programs
add_devices(devs)
class ISYSwitchDevice(ISYDeviceABC):
""" represents as isy light within home assistant. """
_domain = 'switch'
_dtype = 'binary'
_states = [STATE_ON, STATE_OFF]