Added hidden_string and sensor_string properties to the isy994 configuration to allow nodes to be hidden and to be handled as sensors. Implimented the sensor_string. Any node name that contains the sensor_string in its name will be treated as a sensor instead of a switch or light. The hidden_string will be implimented later.
This commit is contained in:
1 parent
0e9a8a7cc2
commit
83aea10f06
4 files changed
+35
-22
No files matched your search
@@ -3,7 +3,7 @@
|
||||
import logging
|
||||
|
||||
# homeassistant imports
|
||||
from homeassistant.components.isy994 import ISY, ISYDeviceABC
|
||||
from homeassistant.components.isy994 import ISY, ISYDeviceABC, SENSOR_STRING
|
||||
from homeassistant.const import (STATE_OPEN, STATE_CLOSED, STATE_HOME,
|
||||
STATE_NOT_HOME, STATE_ON, STATE_OFF)
|
||||
|
||||
@@ -26,6 +26,11 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
getattr(ISY.climate, prop + '_units'))
|
||||
devs.append(ISYSensorDevice(node))
|
||||
|
||||
# import sensor nodes
|
||||
for node in ISY.nodes:
|
||||
if SENSOR_STRING in node.name:
|
||||
devs.append(ISYSensorDevice(node, [STATE_ON, STATE_OFF]))
|
||||
|
||||
# import sensor programs
|
||||
for (folder_name, states) in (
|
||||
('HA.locations', [STATE_HOME, STATE_NOT_HOME]),
|
||||
|
||||
Reference in new issue
Block a user