mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Updated isy994 component to hide any device with the HIDDEN STRING in its ancestry.
This commit is contained in:
parent
b20424261c
commit
6b2dd69bcb
@ -113,6 +113,7 @@ def setup(hass, config):
|
|||||||
|
|
||||||
class Group(object):
|
class Group(object):
|
||||||
""" Tracks a group of entity ids. """
|
""" Tracks a group of entity ids. """
|
||||||
|
# pylint: disable=too-many-instance-attributes
|
||||||
|
|
||||||
visibility = Entity.visibility
|
visibility = Entity.visibility
|
||||||
_hidden = False
|
_hidden = False
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
# homeassistant imports
|
# 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.components.light import ATTR_BRIGHTNESS
|
||||||
from homeassistant.const import STATE_ON, STATE_OFF
|
from homeassistant.const import STATE_ON, STATE_OFF
|
||||||
|
|
||||||
@ -18,8 +19,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
# import dimmable nodes
|
# 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 node.dimmable and SENSOR_STRING not in node.name:
|
||||||
|
if HIDDEN_STRING in path:
|
||||||
|
node.name += HIDDEN_STRING
|
||||||
devs.append(ISYLightDevice(node))
|
devs.append(ISYLightDevice(node))
|
||||||
|
|
||||||
add_devices(devs)
|
add_devices(devs)
|
||||||
|
@ -37,15 +37,18 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
if ISY.climate is not None:
|
if ISY.climate is not None:
|
||||||
for prop in ISY.climate._id2name:
|
for prop in ISY.climate._id2name:
|
||||||
if prop is not None:
|
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,
|
node = WeatherPseudoNode('ISY.weather.' + prop, prefix + prop,
|
||||||
getattr(ISY.climate, prop),
|
getattr(ISY.climate, prop),
|
||||||
getattr(ISY.climate, prop + '_units'))
|
getattr(ISY.climate, prop + '_units'))
|
||||||
devs.append(ISYSensorDevice(node))
|
devs.append(ISYSensorDevice(node))
|
||||||
|
|
||||||
# import sensor nodes
|
# import sensor nodes
|
||||||
for node in ISY.nodes:
|
for (path, node) in ISY.nodes:
|
||||||
if SENSOR_STRING in node.name:
|
if SENSOR_STRING in node.name:
|
||||||
|
if HIDDEN_STRING in path:
|
||||||
|
node.name += HIDDEN_STRING
|
||||||
devs.append(ISYSensorDevice(node, [STATE_ON, STATE_OFF]))
|
devs.append(ISYSensorDevice(node, [STATE_ON, STATE_OFF]))
|
||||||
|
|
||||||
# import sensor programs
|
# import sensor programs
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
# homeassistant imports
|
# 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
|
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.
|
# 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
|
# 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
|
return False
|
||||||
|
|
||||||
# import not dimmable nodes and groups
|
# 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 not node.dimmable and SENSOR_STRING not in node.name:
|
||||||
|
if HIDDEN_STRING in path:
|
||||||
|
node.name += HIDDEN_STRING
|
||||||
devs.append(ISYSwitchDevice(node))
|
devs.append(ISYSwitchDevice(node))
|
||||||
|
|
||||||
# import ISY doors programs
|
# import ISY doors programs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user