-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathUsing_IsyNode_Class.txt
More file actions
145 lines (102 loc) · 3.26 KB
/
Copy pathUsing_IsyNode_Class.txt
File metadata and controls
145 lines (102 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
Using the IsyNode Class
======================
Examples
--------
Get and print the status for the node called "Garage Light"
import ISY
myisy = ISY.Isy()
garage_light = myisy.get_node("Garage Light")
print "Node {:} is {:}".format(garage_light.name, garage_light.formatted)
--
Get an object that represents the node called "Garage Light"
and turn it off if it is on
import ISY
myisy = ISY.Isy()
garage_light = myisy.get_node("Garage Light")
if garage_light :
garage_light.off()
--
Alternately you can obtain a Node's object by indexing
a Isy obj my the node name or address
import ISY
myisy = ISY.Isy()
myisy["Garage Light"].off()
Note this works by instantiating a IsyNode class obj then calling
the IsyNode class mothod off() and discarding referance to the instance.
(Note that the Isy Class caches created instances, so this not realy a loss)
In this case using the Isy class obj method node_comm() is more
efficient since the IsyNode mothod on() & off() simply call node_comm()
--
Turn Node on to 50% ( assuming Node a dimable light )
import ISY
myisy = ISY.Isy()
garage_light = myisy.get_node("Garage Light")
garage_light.on( 255 * .5 )
Note that devices are set with values from 0 - 255
thus setting a light to the value of 50 will actually set it to 20%
Note: the following are equivalent
garage_light.on( 255 * .5 )
myisy.node_comm("Garage Light", "DON", 128)
The following are "redirected" to the on command
garage_light.status = 128
garage_light.set_status(128)
since the status property is readonly
--
Turn on the "Garage Light"
without instantiating a IsyNode class obj
import ISY
myisy = ISY.Isy()
myisy.node_comm("Garage Light", "DON")
--
List all Node names and some of their attributes
import ISY
myisy = ISY.Isy( )
pfmt = "{:<20} {:<12}\t{:<12}"
print(pfmt.format("Node Name", "Address", "Status"))
print(pfmt.format("---------", "-------", "------"))
for nod in myisy :
if nod.type == "scene" :
print(pfmt.format(nod.name, nod.address, "-"))
else :
print(pfmt.format(nod.name, nod.address, nod.formatted))
# print(" members : ", len(nod.members_list()))
--
Members
--------
def on(self, *args) :
def off(self) :
def beep(self) :
def member_iter(self):
def member_list(self):
def is_member(self, obj) :
def __contains__(self, other):
# def __contains__(self, other):
def __init__(self, isy, ndict) :
def _get_prop(self, prop):
def _set_prop(self, prop, new_value):
def get_rr(self):
def set_rr(self, new_value):
def get_ol(self):
def set_ol(self, new_value):
# def get_fm(self):
def get_status(self):
def set_status(self, new_value):
# def on(self) :
# def off(self) :
# def beep(self) :
def update(self) :
def __bool__(self) :
def __hash__(self) :
# def __str__(self):
def __float__(self):
def set_status(self, new_value):
def _gettype(self):
def _getmembers(self) :
def member_list(self) :
def is_member(self, obj) :
def member_iter(self, flag=0):
def __iter__(self):
def __contains__(self, other):
def _gettype(self):
def __iter__(self):
def __contains__(self, other):