forked from OpenZWave/python-openzwave
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetwork.html
More file actions
729 lines (693 loc) · 32.1 KB
/
Copy pathnetwork.html
File metadata and controls
729 lines (693 loc) · 32.1 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
<div class="section" id="network-documentation">
<h1>Network documentation</h1>
<p>This is the central point. Everything is attached to a network.</p>
<div class="toctree-wrapper compound">
<ul class="simple">
</ul>
</div>
<span class="target" id="module-openzwave.network"></span><span class="target" id="module-openzwave.network"></span><dl class="docutils">
<dt>This file is part of <strong>python-openzwave</strong> project <a class="reference external" href="https://github.com/OpenZWave/python-openzwave">https://github.com/OpenZWave/python-openzwave</a>.</dt>
<dd><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">platform:</th><td class="field-body">Unix, Windows, MacOS X</td>
</tr>
<tr class="field-even field"><th class="field-name">sinopsis:</th><td class="field-body">openzwave API</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p>License : GPL(v3)</p>
<p><strong>python-openzwave</strong> is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.</p>
<p><strong>python-openzwave</strong> is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with python-openzwave. If not, see <a class="reference external" href="http://www.gnu.org/licenses">http://www.gnu.org/licenses</a>.</p>
<dl class="class">
<dt id="openzwave.network.ZWaveNetwork">
<em class="property">class </em><tt class="descclassname">openzwave.network.</tt><tt class="descname">ZWaveNetwork</tt><big>(</big><em>options</em>, <em>log=None</em>, <em>autostart=True</em>, <em>kvals=True</em><big>)</big></dt>
<dd><p>The network objet = homeid.
It contains a reference to the manager and the controller.</p>
<p>It dispatch the following louie signals :</p>
<blockquote>
<div><ul class="simple">
<li>SIGNAL_NETWORK_FAILED = ‘NetworkFailed’</li>
<li>SIGNAL_NETWORK_STARTED = ‘NetworkStarted’</li>
<li>SIGNAL_NETWORK_READY = ‘NetworkReady’</li>
<li>SIGNAL_NETWORK_STOPPED = ‘NetworkStopped’</li>
<li>SIGNAL_NETWORK_RESETTED = ‘DriverResetted’</li>
<li>SIGNAL_NETWORK_AWAKED = ‘DriverAwaked’</li>
<li>SIGNAL_DRIVER_FAILED = ‘DriverFailed’</li>
<li>SIGNAL_DRIVER_READY = ‘DriverReady’</li>
<li>SIGNAL_DRIVER_RESET = ‘DriverReset’</li>
<li>SIGNAL_DRIVER_REMOVED = ‘DriverRemoved’</li>
<li>SIGNAL_NODE_ADDED = ‘NodeAdded’</li>
<li>SIGNAL_NODE_EVENT = ‘NodeEvent’</li>
<li>SIGNAL_NODE_NAMING = ‘NodeNaming’</li>
<li>SIGNAL_NODE_NEW = ‘NodeNew’</li>
<li>SIGNAL_NODE_PROTOCOL_INFO = ‘NodeProtocolInfo’</li>
<li>SIGNAL_NODE_READY = ‘NodeReady’</li>
<li>SIGNAL_NODE_REMOVED = ‘NodeRemoved’</li>
<li>SIGNAL_SCENE_EVENT = ‘SceneEvent’</li>
<li>SIGNAL_VALUE_ADDED = ‘ValueAdded’</li>
<li>SIGNAL_VALUE_CHANGED = ‘ValueChanged’</li>
<li>SIGNAL_VALUE_REFRESHED = ‘ValueRefreshed’</li>
<li>SIGNAL_VALUE_REMOVED = ‘ValueRemoved’</li>
<li>SIGNAL_POLLING_ENABLED = ‘PollingEnabled’</li>
<li>SIGNAL_POLLING_DISABLED = ‘PollingDisabled’</li>
<li>SIGNAL_CREATE_BUTTON = ‘CreateButton’</li>
<li>SIGNAL_DELETE_BUTTON = ‘DeleteButton’</li>
<li>SIGNAL_BUTTON_ON = ‘ButtonOn’</li>
<li>SIGNAL_BUTTON_OFF = ‘ButtonOff’</li>
<li>SIGNAL_ESSENTIAL_NODE_QUERIES_COMPLETE = ‘EssentialNodeQueriesComplete’</li>
<li>SIGNAL_NODE_QUERIES_COMPLETE = ‘NodeQueriesComplete’</li>
<li>SIGNAL_AWAKE_NODES_QUERIED = ‘AwakeNodesQueried’</li>
<li>SIGNAL_ALL_NODES_QUERIED = ‘AllNodesQueried’</li>
<li>SIGNAL_MSG_COMPLETE = ‘MsgComplete’</li>
<li>SIGNAL_ERROR = ‘Error’</li>
</ul>
</div></blockquote>
<p>The table presented below sets notifications in the order they might typically be received,
and grouped into a few logically related categories. Of course, given the variety
of ZWave controllers, devices and network configurations the actual sequence will vary (somewhat).
The descriptions below the notification name (in square brackets) identify whether the
notification is always sent (unless there’s a significant error in the network or software)
or potentially sent during the execution sequence.</p>
<p>Driver Initialization Notification</p>
<p>The notification below is sent when OpenZWave has successfully connected
to a physical ZWave controller.</p>
<ul class="simple">
<li>DriverReady</li>
</ul>
<p>[always sent] Sent when the driver (representing a connection between OpenZWave
and a Z-Wave controller attached to the specified serial (or HID) port) has been initialized.
At the time this notification is sent, only certain information about the controller itself is known:</p>
<blockquote>
<div><ul class="simple">
<li>Controller Z-Wave version</li>
<li>Network HomeID</li>
<li>Controller capabilities</li>
<li>Controller Application Version & Manufacturer/Product ID</li>
<li>Nodes included in the network</li>
</ul>
</div></blockquote>
<ul class="simple">
<li>DriverRemoved</li>
</ul>
<p>[always sent (either due to Error or by request)] The Driver is being removed.
Do Not Call Any Driver Related Methods after receiving this</p>
<p>Node Initialization Notifications</p>
<p>As OpenZWave starts, it identifies and reads information about each node in the network.
The following notifications may be sent during the initialization process.</p>
<ul class="simple">
<li>NodeNew</li>
</ul>
<p>[potentially sent] Sent when a new node has been identified as part of the Z-Wave network.
It is not sent if the node was identified in a prior execution of the OpenZWave library
and stored in the zwcfg*.xml file.
At the time this notification is sent, very little is known about the node itself...
only that it is new to OpenZWave. This message is sent once for each new node identified.</p>
<ul class="simple">
<li>NodeAdded</li>
</ul>
<p>[always sent (for each node associated with the controller)]
Sent when a node has been added to OpenZWave’s set of nodes. It can be
triggered either as the zwcfg*.xml file is being read, when a new node
is found on startup (see NodeNew notification above), or if a new node
is included in the network while OpenZWave is running.
As with NodeNew, very little is known about the node at the time the
notification is sent…just the fact that a new node has been identified
and its assigned NodeID.</p>
<ul class="simple">
<li>NodeProtocolInfo</li>
</ul>
<p>[potentially sent] Sent after a node’s protocol information has been
successfully read from the controller.
At the time this notification is sent, only certain information about the node is known:</p>
<blockquote>
<div><ul class="simple">
<li>Whether it is a “listening” or “sleeping” device</li>
<li>Whether the node is capable of routing messages</li>
<li>Maximum baud rate for communication</li>
<li>Version number</li>
<li>Security byte</li>
</ul>
</div></blockquote>
<p>NodeNaming</p>
<p>[potentially sent] Sent when a node’s name has been set or changed
(although it may be “set” to “” or NULL).</p>
<ul class="simple">
<li>ValueAdded</li>
</ul>
<p>[potentially sent] Sent when a new value has been associated with the node.
At the time this notification is sent, the new value may or may not
have “live” data associated with it. It may be populated, but it may
alternatively just be a placeholder for a value that has not been read
at the time the notification is sent.</p>
<ul class="simple">
<li>NodeQueriesComplete</li>
</ul>
<p>[always sent (for each node associated with the controller that has been successfully queried)] Sent when a node’s values and attributes have been fully queried. At the time this notification is sent, the node’s information has been fully read at least once. So this notification might trigger “full” display of the node’s information, values, etc. If this notification is not sent, it indicates that there has been a problem initializing the device. The most common issue is that the node is a “sleeping” device. The NodeQueriesComplete notification will be sent when the node wakes up and the query process completes.</p>
<p>Initialization Complete Notifications</p>
<p>As indicated above, when OpenZWave starts it reads certain information
from a file, from the controller and from the network. The following
notifications identify when this initialization/querying process is complete.</p>
<ul class="simple">
<li>AwakeNodesQueried</li>
</ul>
<p>[always sent] Sent when all “listening” -always-on-devices have been
queried successfully. It also indicates, by implication, that there
are some “sleeping” nodes that will not complete their queries until
they wake up. This notification should be sent relatively quickly
after start-up. (Of course, it depends on the number of devices on
the ZWave network and whether there are any messages that “time out”
without a proper response.)</p>
<ul class="simple">
<li>AllNodesQueried</li>
</ul>
<p>[potentially sent] Sent when all nodes have been successfully queried.</p>
<p>This notification should be sent relatively quickly if there are
no “sleeping” nodes. But it might be sent quite a while after start-up
if there are sleeping nodes and at least one of these nodes has a long “wake-up” interval.</p>
<p>Other Notifications</p>
<p>In addition to the notifications described above, which are primarily
“initialization” notifications that are sent during program start-up,
the following notifications may be sent as a result of user actions,
external program control, etc.</p>
<ul class="simple">
<li>ValueChanged : Sent when a value associated with a node has changed. Receipt of this notification indicates that it may be a good time to read the new value and display or otherwise process it accordingly.</li>
<li>ValueRemoved : Sent when a value associated with a node has been removed.</li>
<li>Group : Sent when a node’s group association has changed.</li>
<li>NodeRemoved : Sent when a node has been removed from the ZWave network.</li>
<li>NodeEvent : Sent when a node sends a Basic_Set command to the controller. This notification can be generated by certain sensors, for example, motion detectors, to indicate that an event has been sensed.</li>
<li>PollingEnabled : Sent when node/value polling has been enabled.</li>
<li>PollingDisabled : Sent when node/value polling has been disabled.</li>
<li>DriverReset : Sent to indicate when a controller has been reset. This notification is intended to replace the potentially hundreds of notifications representing each value and node removed from the network.</li>
</ul>
<p>About the use of louie signals :
For network, python-openzwave send the following louie signal :</p>
<blockquote>
<div>SIGNAL_NETWORK_FAILED : the driver has failed to start.
SIGNAL_NETWORK_STARTED : the driver is ready, but network is not available.
SIGNAL_NETWORK_AWAKED : all awake nodes are queried. Some sleeping nodes may be missing.
SIGNAL_NETWORK_READY : all nodes are queried. Network is fully functionnal.
SIGNAL_NETWORK_RESETTED : the network has been resetted. It will start again.
SIGNAL_NETWORK_STOPPED : the network has been stopped.</div></blockquote>
<p>Deprecated : SIGNAL_DRIVER_* shouldn’t be used anymore.</p>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.controller">
<tt class="descname">controller</tt></dt>
<dd><p>The controller of the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The controller of the network</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">ZWaveController</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.create_scene">
<tt class="descname">create_scene</tt><big>(</big><em>label=None</em><big>)</big></dt>
<dd><p>Create a new scene on the network.
If label is set, also change the label of the scene</p>
<p>If you store your scenes on a local variable, get a new one
to get the scene id</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>label</strong> (<em>str or None</em>) – The new label</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">return the id of scene on the network. Return 0 if fails</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.destroy">
<tt class="descname">destroy</tt><big>(</big><big>)</big></dt>
<dd><p>Destroy the netwok and all related stuff.</p>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.get_poll_interval">
<tt class="descname">get_poll_interval</tt><big>(</big><big>)</big></dt>
<dd><p>Get the time period between polls of a nodes state</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The number of milliseconds between polls</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.get_scenes">
<tt class="descname">get_scenes</tt><big>(</big><big>)</big></dt>
<dd><p>The scenes of the network.</p>
<p>Scenes are generated directly from the lib. There is no notification
support to keep them up to date. So for a batch job, consider
storing them in a local variable.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">return a dict() (that can be empty) of scene object. Return None if betwork is not ready</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict() or None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.get_value">
<tt class="descname">get_value</tt><big>(</big><em>value_id</em><big>)</big></dt>
<dd><p>Retrieve a value on the network.</p>
<p>Check every nodes to see if it holds the value</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value_id</strong> (<em>int</em>) – The id of the value to find</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The value or None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">ZWaveValue</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.get_value_from_id_on_network">
<tt class="descname">get_value_from_id_on_network</tt><big>(</big><em>id_on_network</em><big>)</big></dt>
<dd><p>Retrieve a value on the network from it’s id_on_network.</p>
<p>Check every nodes to see if it holds the value</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>id_on_network</strong> (<em>str</em>) – The id_on_network of the value to find</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The value or None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">ZWaveValue</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.heal">
<tt class="descname">heal</tt><big>(</big><em>upNodeRoute=False</em><big>)</big></dt>
<dd><p>Heal network by requesting nodes rediscover their neighbors.
Sends a ControllerCommand_RequestNodeNeighborUpdate to every node.
Can take a while on larger networks.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>upNodeRoute</strong> (<em>bool</em>) – Optional Whether to perform return routes initialization. (default = false).</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True is the ControllerCommand ins sent. False otherwise</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.home_id">
<tt class="descname">home_id</tt></dt>
<dd><p>The home_id of the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.home_id_str">
<tt class="descname">home_id_str</tt></dt>
<dd><p>The home_id of the network as string.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.id_separator">
<tt class="descname">id_separator</tt></dt>
<dd><p>The separator in id representation.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">char</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.is_ready">
<tt class="descname">is_ready</tt></dt>
<dd><p>Says if the network is ready for operations.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.manager">
<tt class="descname">manager</tt></dt>
<dd><p>The manager to use to communicate with the lib c++.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">ZWaveManager</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.nodes">
<tt class="descname">nodes</tt></dt>
<dd><p>The nodes of the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict()</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.nodes_count">
<tt class="descname">nodes_count</tt></dt>
<dd><p>The nodes count of the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.nodes_to_dict">
<tt class="descname">nodes_to_dict</tt><big>(</big><em>extras=['all']</em><big>)</big></dt>
<dd><p>Return a dict representation of the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>extras</strong> (<em>[]</em>) – The extra inforamtions to add</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict()</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.remove_scene">
<tt class="descname">remove_scene</tt><big>(</big><em>scene_id</em><big>)</big></dt>
<dd><p>Delete the scene on the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>scene_id</strong> (<em>int</em>) – The id of the scene to check</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True if the scene was removed. False in other cases</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.scene_exists">
<tt class="descname">scene_exists</tt><big>(</big><em>scene_id</em><big>)</big></dt>
<dd><p>Check that the scene exists</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>scene_id</strong> (<em>int</em>) – The id of the scene to check</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True if the scene exist. False in other cases</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.scenes_count">
<tt class="descname">scenes_count</tt></dt>
<dd><p>Return the number of scenes</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The number of scenes</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.scenes_to_dict">
<tt class="descname">scenes_to_dict</tt><big>(</big><em>extras=['all']</em><big>)</big></dt>
<dd><p>Return a JSONifiable dict representation of the scenes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>extras</strong> (<em>[]</em>) – The extra inforamtions to add</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict()</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.set_poll_interval">
<tt class="descname">set_poll_interval</tt><big>(</big><em>milliseconds=500</em>, <em>bIntervalBetweenPolls=True</em><big>)</big></dt>
<dd><p>Set the time period between polls of a nodes state.</p>
<p>Due to patent concerns, some devices do not report state changes automatically
to the controller. These devices need to have their state polled at regular
intervals. The length of the interval is the same for all devices. To even
out the Z-Wave network traffic generated by polling, OpenZWave divides the
polling interval by the number of devices that have polling enabled, and polls
each in turn. It is recommended that if possible, the interval should not be
set shorter than the number of polled devices in seconds (so that the network
does not have to cope with more than one poll per second).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>milliseconds</strong> (<em>int</em>) – The length of the polling interval in milliseconds.</li>
<li><strong>bIntervalBetweenPolls</strong> (<em>bool</em>) – If set to true (via SetPollInterval), the pollInterval will be interspersed between each poll (so a much smaller m_pollInterval like 100, 500, or 1,000 may be appropriate). If false, the library attempts to complete all polls within m_pollInterval.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.sleeping_nodes_count">
<tt class="descname">sleeping_nodes_count</tt></dt>
<dd><p>The count of sleeping nodes on the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.start">
<tt class="descname">start</tt><big>(</big><big>)</big></dt>
<dd><dl class="docutils">
<dt>Start the network object :</dt>
<dd><ul class="first last simple">
<li>add a watcher</li>
<li>add a driver</li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.state">
<tt class="descname">state</tt></dt>
<dd><p>The state of the network. Values may be changed in the future,
only order is important.
You can safely ask node information when state >= STATE_READY</p>
<ul class="simple">
<li>STATE_STOPPED = 0</li>
<li>STATE_FAILED = 1</li>
<li>STATE_RESETTED = 3</li>
<li>STATE_STARTED = 5</li>
<li>STATE_AWAKED = 7</li>
<li>STATE_READY = 10</li>
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="openzwave.network.ZWaveNetwork.state_str">
<tt class="descname">state_str</tt></dt>
<dd><p>The state of the network. Values may be changed in the future,
only order is important.
You can safely ask node informations when state >= STATE_AWAKED</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.stop">
<tt class="descname">stop</tt><big>(</big><em>fire=True</em><big>)</big></dt>
<dd><p>Stop the network object.</p>
<blockquote>
<div><ul class="simple">
<li>remove the watcher</li>
<li>remove the driver</li>
<li>clear the nodes</li>
</ul>
</div></blockquote>
<div class="highlight-python"><div class="highlight"><pre><span class="n">dispatcher</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">SIGNAL_NETWORK_STOPPED</span><span class="p">,</span> <span class="o">**</span><span class="p">{</span><span class="s">'network'</span><span class="p">:</span> <span class="bp">self</span><span class="p">})</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.switch_all">
<tt class="descname">switch_all</tt><big>(</big><em>state</em><big>)</big></dt>
<dd><p>Method for switching all devices on or off together. The devices must support
the SwitchAll command class. The command is first broadcast to all nodes, and
then followed up with individual commands to each node (because broadcasts are
not routed, the message might not otherwise reach all the nodes).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>state</strong> (<em>bool</em>) – True to turn on the switches, False to turn them off</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.test">
<tt class="descname">test</tt><big>(</big><em>count=1</em><big>)</big></dt>
<dd><p>Send a number of test messages to every node and record results.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>count</strong> (<em>int</em>) – The number of test messages to send.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.to_dict">
<tt class="descname">to_dict</tt><big>(</big><em>extras=['kvals']</em><big>)</big></dt>
<dd><p>Return a dict representation of the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>extras</strong> (<em>[]</em>) – The extra inforamtions to add</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict()</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.write_config">
<tt class="descname">write_config</tt><big>(</big><big>)</big></dt>
<dd><p>The last message that was sent is now complete.</p>
</dd></dl>
<dl class="method">
<dt id="openzwave.network.ZWaveNetwork.zwcallback">
<tt class="descname">zwcallback</tt><big>(</big><em>args</em><big>)</big></dt>
<dd><p>The Callback Handler used with the libopenzwave.</p>
<p>n[‘valueId’] = {</p>
<blockquote>
<div><ul class="simple">
<li>‘home_id’ : v.GetHomeId(),</li>
<li>‘node_id’ : v.GetNodeId(),</li>
<li>‘commandClass’ : PyManager.COMMAND_CLASS_DESC[v.GetCommandClassId()],</li>
<li>‘instance’ : v.GetInstance(),</li>
<li>‘index’ : v.GetIndex(),</li>
<li>‘id’ : v.GetId(),</li>
<li>‘genre’ : PyGenres[v.GetGenre()],</li>
<li>‘type’ : PyValueTypes[v.GetType()],</li>
<li>#’value’ : value.c_str(),</li>
<li>‘value’ : getValueFromType(manager,v.GetId()),</li>
<li>‘label’ : label.c_str(),</li>
<li>‘units’ : units.c_str(),</li>
<li>‘readOnly’: manager.IsValueReadOnly(v)</li>
</ul>
</div></blockquote>
<p>}</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>args</strong> (<em>dict()</em>) – A dict containing informations about the state of the controller</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>