Updated isy994 component to hide any device with the HIDDEN STRING in its ancestry.

This commit is contained in:
Ryan Kraus 2015-04-17 09:27:14 -04:00
parent b20424261c
commit 6b2dd69bcb
4 changed files with 16 additions and 6 deletions

View file

@ -113,6 +113,7 @@ def setup(hass, config):
class Group(object):
""" Tracks a group of entity ids. """
# pylint: disable=too-many-instance-attributes
visibility = Entity.visibility
_hidden = False

View file

@ -3,7 +3,8 @@
import logging
# homeassistant imports
from homeassistant.components.isy994 import ISYDeviceABC, ISY, SENSOR_STRING
from homeassistant.components.isy994 import (ISYDeviceABC, ISY, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.components.light import ATTR_BRIGHTNESS
from homeassistant.const import STATE_ON, STATE_OFF
@ -18,8 +19,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
return False
# import dimmable nodes
for node in ISY.nodes:
for (path, node) in ISY.nodes:
if node.dimmable and SENSOR_STRING not in node.name:
if HIDDEN_STRING in path:
node.name += HIDDEN_STRING
devs.append(ISYLightDevice(node))
add_devices(devs)

View file

@ -37,15 +37,18 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
if ISY.climate is not None:
for prop in ISY.climate._id2name:
if prop is not None:
prefix = HIDDEN_STRING if prop in DEFAULT_HIDDEN_WEATHER else ''
prefix = HIDDEN_STRING \
if prop in DEFAULT_HIDDEN_WEATHER else ''
node = WeatherPseudoNode('ISY.weather.' + prop, prefix + prop,
getattr(ISY.climate, prop),
getattr(ISY.climate, prop + '_units'))
devs.append(ISYSensorDevice(node))
# import sensor nodes
for node in ISY.nodes:
for (path, node) in ISY.nodes:
if SENSOR_STRING in node.name:
if HIDDEN_STRING in path:
node.name += HIDDEN_STRING
devs.append(ISYSensorDevice(node, [STATE_ON, STATE_OFF]))
# import sensor programs

View file

@ -3,7 +3,8 @@
import logging
# homeassistant imports
from homeassistant.components.isy994 import ISY, ISYDeviceABC, SENSOR_STRING
from homeassistant.components.isy994 import (ISY, ISYDeviceABC, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.const import STATE_ON, STATE_OFF # STATE_OPEN, STATE_CLOSED
# The frontend doesn't seem to fully support the open and closed states yet.
# Once it does, the HA.doors programs should report open and closed instead of
@ -20,8 +21,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
return False
# import not dimmable nodes and groups
for node in ISY.nodes:
for (path, node) in ISY.nodes:
if not node.dimmable and SENSOR_STRING not in node.name:
if HIDDEN_STRING in path:
node.name += HIDDEN_STRING
devs.append(ISYSwitchDevice(node))
# import ISY doors programs