A clone of: https://github.com/nutechsoftware/alarmdecoder This is requires as they dropped support for older firmware releases w/o building in backward compatibility code, and they had previously hardcoded pyserial to a python2 only version.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1277 lines
70 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>pyad2usb Package &mdash; pyad2 documentation</title>
  7. <link rel="stylesheet" href="_static/default.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: './',
  12. VERSION: '',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/underscore.js"></script>
  20. <script type="text/javascript" src="_static/doctools.js"></script>
  21. <link rel="top" title="pyad2 documentation" href="index.html" />
  22. </head>
  23. <body>
  24. <div class="related">
  25. <h3>Navigation</h3>
  26. <ul>
  27. <li class="right" style="margin-right: 10px">
  28. <a href="genindex.html" title="General Index"
  29. accesskey="I">index</a></li>
  30. <li class="right" >
  31. <a href="py-modindex.html" title="Python Module Index"
  32. >modules</a> |</li>
  33. <li><a href="index.html">pyad2 documentation</a> &raquo;</li>
  34. </ul>
  35. </div>
  36. <div class="document">
  37. <div class="documentwrapper">
  38. <div class="bodywrapper">
  39. <div class="body">
  40. <div class="section" id="pyad2usb-package">
  41. <h1>pyad2usb Package<a class="headerlink" href="#pyad2usb-package" title="Permalink to this headline">¶</a></h1>
  42. <div class="section" id="module-pyad2.ad2">
  43. <span id="ad2-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">ad2</span></tt> Module<a class="headerlink" href="#module-pyad2.ad2" title="Permalink to this headline">¶</a></h2>
  44. <p>Provides the full AD2USB class and factory.</p>
  45. <dl class="class">
  46. <dt id="pyad2.ad2.Overseer">
  47. <em class="property">class </em><tt class="descclassname">pyad2.ad2.</tt><tt class="descname">Overseer</tt><big>(</big><em>attached_event=None</em>, <em>detached_event=None</em><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer" title="Permalink to this definition">¶</a></dt>
  48. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  49. <p>Factory for creation of AD2USB devices as well as provides attach/detach events.&#8221;</p>
  50. <dl class="attribute">
  51. <dt id="pyad2.ad2.Overseer.on_attached">
  52. <tt class="descname">on_attached</tt><a class="headerlink" href="#pyad2.ad2.Overseer.on_attached" title="Permalink to this definition">¶</a></dt>
  53. <dd><p>Called when an AD2USB device has been detected.</p>
  54. </dd></dl>
  55. <dl class="attribute">
  56. <dt id="pyad2.ad2.Overseer.on_detached">
  57. <tt class="descname">on_detached</tt><a class="headerlink" href="#pyad2.ad2.Overseer.on_detached" title="Permalink to this definition">¶</a></dt>
  58. <dd><p>Called when an AD2USB device has been removed.</p>
  59. </dd></dl>
  60. <dl class="classmethod">
  61. <dt id="pyad2.ad2.Overseer.find_all">
  62. <em class="property">classmethod </em><tt class="descname">find_all</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer.find_all"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer.find_all" title="Permalink to this definition">¶</a></dt>
  63. <dd><p>Returns all AD2USB devices located on the system.</p>
  64. <table class="docutils field-list" frame="void" rules="none">
  65. <col class="field-name" />
  66. <col class="field-body" />
  67. <tbody valign="top">
  68. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">list of devices found</td>
  69. </tr>
  70. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body">util.CommError</td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. </dd></dl>
  75. <dl class="classmethod">
  76. <dt id="pyad2.ad2.Overseer.devices">
  77. <em class="property">classmethod </em><tt class="descname">devices</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer.devices"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer.devices" title="Permalink to this definition">¶</a></dt>
  78. <dd><p>Returns a cached list of AD2USB devices located on the system.</p>
  79. <table class="docutils field-list" frame="void" rules="none">
  80. <col class="field-name" />
  81. <col class="field-body" />
  82. <tbody valign="top">
  83. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">cached list of devices found.</td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. </dd></dl>
  88. <dl class="classmethod">
  89. <dt id="pyad2.ad2.Overseer.create">
  90. <em class="property">classmethod </em><tt class="descname">create</tt><big>(</big><em>device=None</em><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer.create"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer.create" title="Permalink to this definition">¶</a></dt>
  91. <dd><p>Factory method that returns the requested AD2USB device, or the first device.</p>
  92. <table class="docutils field-list" frame="void" rules="none">
  93. <col class="field-name" />
  94. <col class="field-body" />
  95. <tbody valign="top">
  96. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>device</strong> (<em>tuple</em>) &#8211; Tuple describing the USB device to open, as returned by find_all().</td>
  97. </tr>
  98. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">AD2USB object utilizing the specified device.</td>
  99. </tr>
  100. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body">util.NoDeviceError</td>
  101. </tr>
  102. </tbody>
  103. </table>
  104. </dd></dl>
  105. <dl class="method">
  106. <dt id="pyad2.ad2.Overseer.close">
  107. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer.close" title="Permalink to this definition">¶</a></dt>
  108. <dd><p>Clean up and shut down.</p>
  109. </dd></dl>
  110. <dl class="method">
  111. <dt id="pyad2.ad2.Overseer.start">
  112. <tt class="descname">start</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer.start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer.start" title="Permalink to this definition">¶</a></dt>
  113. <dd><p>Starts the detection thread, if not already running.</p>
  114. </dd></dl>
  115. <dl class="method">
  116. <dt id="pyad2.ad2.Overseer.stop">
  117. <tt class="descname">stop</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer.stop" title="Permalink to this definition">¶</a></dt>
  118. <dd><p>Stops the detection thread.</p>
  119. </dd></dl>
  120. <dl class="method">
  121. <dt id="pyad2.ad2.Overseer.get_device">
  122. <tt class="descname">get_device</tt><big>(</big><em>device=None</em><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer.get_device"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer.get_device" title="Permalink to this definition">¶</a></dt>
  123. <dd><p>Factory method that returns the requested AD2USB device, or the first device.</p>
  124. <table class="docutils field-list" frame="void" rules="none">
  125. <col class="field-name" />
  126. <col class="field-body" />
  127. <tbody valign="top">
  128. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>device</strong> (<em>tuple</em>) &#8211; Tuple describing the USB device to open, as returned by find_all().</td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. </dd></dl>
  133. <dl class="class">
  134. <dt id="pyad2.ad2.Overseer.DetectThread">
  135. <em class="property">class </em><tt class="descname">DetectThread</tt><big>(</big><em>overseer</em><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer.DetectThread"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer.DetectThread" title="Permalink to this definition">¶</a></dt>
  136. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">threading.Thread</span></tt></p>
  137. <p>Thread that handles detection of added/removed devices.</p>
  138. <dl class="method">
  139. <dt id="pyad2.ad2.Overseer.DetectThread.stop">
  140. <tt class="descname">stop</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer.DetectThread.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer.DetectThread.stop" title="Permalink to this definition">¶</a></dt>
  141. <dd><p>Stops the thread.</p>
  142. </dd></dl>
  143. <dl class="method">
  144. <dt id="pyad2.ad2.Overseer.DetectThread.run">
  145. <tt class="descname">run</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#Overseer.DetectThread.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.Overseer.DetectThread.run" title="Permalink to this definition">¶</a></dt>
  146. <dd><p>The actual detection process.</p>
  147. </dd></dl>
  148. </dd></dl>
  149. </dd></dl>
  150. <dl class="class">
  151. <dt id="pyad2.ad2.AD2">
  152. <em class="property">class </em><tt class="descclassname">pyad2.ad2.</tt><tt class="descname">AD2</tt><big>(</big><em>device</em><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#AD2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.AD2" title="Permalink to this definition">¶</a></dt>
  153. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  154. <p>High-level wrapper around AD2USB/AD2SERIAL devices.</p>
  155. <dl class="attribute">
  156. <dt id="pyad2.ad2.AD2.on_arm">
  157. <tt class="descname">on_arm</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_arm" title="Permalink to this definition">¶</a></dt>
  158. <dd><p>Called when the panel is armed.</p>
  159. </dd></dl>
  160. <dl class="attribute">
  161. <dt id="pyad2.ad2.AD2.on_disarm">
  162. <tt class="descname">on_disarm</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_disarm" title="Permalink to this definition">¶</a></dt>
  163. <dd><p>Called when the panel is disarmed.</p>
  164. </dd></dl>
  165. <dl class="attribute">
  166. <dt id="pyad2.ad2.AD2.on_power_changed">
  167. <tt class="descname">on_power_changed</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_power_changed" title="Permalink to this definition">¶</a></dt>
  168. <dd><p>Called when panel power switches between AC and DC.</p>
  169. </dd></dl>
  170. <dl class="attribute">
  171. <dt id="pyad2.ad2.AD2.on_alarm">
  172. <tt class="descname">on_alarm</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_alarm" title="Permalink to this definition">¶</a></dt>
  173. <dd><p>Called when the alarm is triggered.</p>
  174. </dd></dl>
  175. <dl class="attribute">
  176. <dt id="pyad2.ad2.AD2.on_fire">
  177. <tt class="descname">on_fire</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_fire" title="Permalink to this definition">¶</a></dt>
  178. <dd><p>Called when a fire is detected.</p>
  179. </dd></dl>
  180. <dl class="attribute">
  181. <dt id="pyad2.ad2.AD2.on_bypass">
  182. <tt class="descname">on_bypass</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_bypass" title="Permalink to this definition">¶</a></dt>
  183. <dd><p>Called when a zone is bypassed.</p>
  184. </dd></dl>
  185. <dl class="attribute">
  186. <dt id="pyad2.ad2.AD2.on_boot">
  187. <tt class="descname">on_boot</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_boot" title="Permalink to this definition">¶</a></dt>
  188. <dd><p>Called when the device finishes bootings.</p>
  189. </dd></dl>
  190. <dl class="attribute">
  191. <dt id="pyad2.ad2.AD2.on_config_received">
  192. <tt class="descname">on_config_received</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_config_received" title="Permalink to this definition">¶</a></dt>
  193. <dd><p>Called when the device receives its configuration.</p>
  194. </dd></dl>
  195. <dl class="attribute">
  196. <dt id="pyad2.ad2.AD2.on_zone_fault">
  197. <tt class="descname">on_zone_fault</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_zone_fault" title="Permalink to this definition">¶</a></dt>
  198. <dd><p>Called when the device detects a zone fault.</p>
  199. </dd></dl>
  200. <dl class="attribute">
  201. <dt id="pyad2.ad2.AD2.on_zone_restore">
  202. <tt class="descname">on_zone_restore</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_zone_restore" title="Permalink to this definition">¶</a></dt>
  203. <dd><p>Called when the device detects that a fault is restored.</p>
  204. </dd></dl>
  205. <dl class="attribute">
  206. <dt id="pyad2.ad2.AD2.on_low_battery">
  207. <tt class="descname">on_low_battery</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_low_battery" title="Permalink to this definition">¶</a></dt>
  208. <dd><p>Called when the device detects a low battery.</p>
  209. </dd></dl>
  210. <dl class="attribute">
  211. <dt id="pyad2.ad2.AD2.on_panic">
  212. <tt class="descname">on_panic</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_panic" title="Permalink to this definition">¶</a></dt>
  213. <dd><p>Called when the device detects a panic.</p>
  214. </dd></dl>
  215. <dl class="attribute">
  216. <dt id="pyad2.ad2.AD2.on_relay_changed">
  217. <tt class="descname">on_relay_changed</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_relay_changed" title="Permalink to this definition">¶</a></dt>
  218. <dd><p>Called when a relay is opened or closed on an expander board.</p>
  219. </dd></dl>
  220. <dl class="attribute">
  221. <dt id="pyad2.ad2.AD2.on_message">
  222. <tt class="descname">on_message</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_message" title="Permalink to this definition">¶</a></dt>
  223. <dd><p>Called when a message has been received from the device.</p>
  224. </dd></dl>
  225. <dl class="attribute">
  226. <dt id="pyad2.ad2.AD2.on_lrr_message">
  227. <tt class="descname">on_lrr_message</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_lrr_message" title="Permalink to this definition">¶</a></dt>
  228. <dd><p>Called when an LRR message is received.</p>
  229. </dd></dl>
  230. <dl class="attribute">
  231. <dt id="pyad2.ad2.AD2.on_rfx_message">
  232. <tt class="descname">on_rfx_message</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_rfx_message" title="Permalink to this definition">¶</a></dt>
  233. <dd><p>Called when an RFX message is received.</p>
  234. </dd></dl>
  235. <dl class="attribute">
  236. <dt id="pyad2.ad2.AD2.on_open">
  237. <tt class="descname">on_open</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_open" title="Permalink to this definition">¶</a></dt>
  238. <dd><p>Called when the device has been opened.</p>
  239. </dd></dl>
  240. <dl class="attribute">
  241. <dt id="pyad2.ad2.AD2.on_close">
  242. <tt class="descname">on_close</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_close" title="Permalink to this definition">¶</a></dt>
  243. <dd><p>Called when the device has been closed.</p>
  244. </dd></dl>
  245. <dl class="attribute">
  246. <dt id="pyad2.ad2.AD2.on_read">
  247. <tt class="descname">on_read</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_read" title="Permalink to this definition">¶</a></dt>
  248. <dd><p>Called when a line has been read from the device.</p>
  249. </dd></dl>
  250. <dl class="attribute">
  251. <dt id="pyad2.ad2.AD2.on_write">
  252. <tt class="descname">on_write</tt><a class="headerlink" href="#pyad2.ad2.AD2.on_write" title="Permalink to this definition">¶</a></dt>
  253. <dd><p>Called when data has been written to the device.</p>
  254. </dd></dl>
  255. <dl class="attribute">
  256. <dt id="pyad2.ad2.AD2.F1">
  257. <tt class="descname">F1</tt><em class="property"> = u'\x01\x01\x01'</em><a class="headerlink" href="#pyad2.ad2.AD2.F1" title="Permalink to this definition">¶</a></dt>
  258. <dd><p>Represents panel function key #1</p>
  259. </dd></dl>
  260. <dl class="attribute">
  261. <dt id="pyad2.ad2.AD2.F2">
  262. <tt class="descname">F2</tt><em class="property"> = u'\x02\x02\x02'</em><a class="headerlink" href="#pyad2.ad2.AD2.F2" title="Permalink to this definition">¶</a></dt>
  263. <dd><p>Represents panel function key #2</p>
  264. </dd></dl>
  265. <dl class="attribute">
  266. <dt id="pyad2.ad2.AD2.F3">
  267. <tt class="descname">F3</tt><em class="property"> = u'\x03\x03\x03'</em><a class="headerlink" href="#pyad2.ad2.AD2.F3" title="Permalink to this definition">¶</a></dt>
  268. <dd><p>Represents panel function key #3</p>
  269. </dd></dl>
  270. <dl class="attribute">
  271. <dt id="pyad2.ad2.AD2.F4">
  272. <tt class="descname">F4</tt><em class="property"> = u'\x04\x04\x04'</em><a class="headerlink" href="#pyad2.ad2.AD2.F4" title="Permalink to this definition">¶</a></dt>
  273. <dd><p>Represents panel function key #4</p>
  274. </dd></dl>
  275. <dl class="attribute">
  276. <dt id="pyad2.ad2.AD2.BATTERY_TIMEOUT">
  277. <tt class="descname">BATTERY_TIMEOUT</tt><em class="property"> = 30</em><a class="headerlink" href="#pyad2.ad2.AD2.BATTERY_TIMEOUT" title="Permalink to this definition">¶</a></dt>
  278. <dd><p>Timeout before the battery status reverts.</p>
  279. </dd></dl>
  280. <dl class="attribute">
  281. <dt id="pyad2.ad2.AD2.FIRE_TIMEOUT">
  282. <tt class="descname">FIRE_TIMEOUT</tt><em class="property"> = 30</em><a class="headerlink" href="#pyad2.ad2.AD2.FIRE_TIMEOUT" title="Permalink to this definition">¶</a></dt>
  283. <dd><p>Timeout before the fire status reverts.</p>
  284. </dd></dl>
  285. <dl class="attribute">
  286. <dt id="pyad2.ad2.AD2.id">
  287. <tt class="descname">id</tt><a class="reference internal" href="_modules/pyad2/ad2.html#AD2.id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.AD2.id" title="Permalink to this definition">¶</a></dt>
  288. <dd><p>The ID of the AD2USB device.</p>
  289. <table class="docutils field-list" frame="void" rules="none">
  290. <col class="field-name" />
  291. <col class="field-body" />
  292. <tbody valign="top">
  293. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The identification string for the device.</td>
  294. </tr>
  295. </tbody>
  296. </table>
  297. </dd></dl>
  298. <dl class="method">
  299. <dt id="pyad2.ad2.AD2.open">
  300. <tt class="descname">open</tt><big>(</big><em>baudrate=None</em>, <em>no_reader_thread=False</em><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#AD2.open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.AD2.open" title="Permalink to this definition">¶</a></dt>
  301. <dd><p>Opens the device.</p>
  302. <table class="docutils field-list" frame="void" rules="none">
  303. <col class="field-name" />
  304. <col class="field-body" />
  305. <tbody valign="top">
  306. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  307. <li><strong>baudrate</strong> (<em>int</em>) &#8211; The baudrate used for the device.</li>
  308. <li><strong>interface</strong> (<em>varies depends on device type.. FIXME</em>) &#8211; The interface used for the device.</li>
  309. <li><strong>index</strong> (<em>int</em>) &#8211; Interface index.. can probably remove. FIXME</li>
  310. <li><strong>no_reader_thread</strong> (<em>bool</em>) &#8211; Specifies whether or not the automatic reader thread should be started or not</li>
  311. </ul>
  312. </td>
  313. </tr>
  314. </tbody>
  315. </table>
  316. </dd></dl>
  317. <dl class="method">
  318. <dt id="pyad2.ad2.AD2.close">
  319. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#AD2.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.AD2.close" title="Permalink to this definition">¶</a></dt>
  320. <dd><p>Closes the device.</p>
  321. </dd></dl>
  322. <dl class="method">
  323. <dt id="pyad2.ad2.AD2.send">
  324. <tt class="descname">send</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#AD2.send"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.AD2.send" title="Permalink to this definition">¶</a></dt>
  325. <dd></dd></dl>
  326. <dl class="method">
  327. <dt id="pyad2.ad2.AD2.get_config">
  328. <tt class="descname">get_config</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#AD2.get_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.AD2.get_config" title="Permalink to this definition">¶</a></dt>
  329. <dd><p>Retrieves the configuration from the device.</p>
  330. </dd></dl>
  331. <dl class="method">
  332. <dt id="pyad2.ad2.AD2.save_config">
  333. <tt class="descname">save_config</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#AD2.save_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.AD2.save_config" title="Permalink to this definition">¶</a></dt>
  334. <dd><p>Sets configuration entries on the device.</p>
  335. </dd></dl>
  336. <dl class="method">
  337. <dt id="pyad2.ad2.AD2.reboot">
  338. <tt class="descname">reboot</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#AD2.reboot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.AD2.reboot" title="Permalink to this definition">¶</a></dt>
  339. <dd><p>Reboots the device.</p>
  340. </dd></dl>
  341. <dl class="method">
  342. <dt id="pyad2.ad2.AD2.fault_zone">
  343. <tt class="descname">fault_zone</tt><big>(</big><em>zone</em>, <em>simulate_wire_problem=False</em><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#AD2.fault_zone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.AD2.fault_zone" title="Permalink to this definition">¶</a></dt>
  344. <dd><p>Faults a zone if we are emulating a zone expander.</p>
  345. <table class="docutils field-list" frame="void" rules="none">
  346. <col class="field-name" />
  347. <col class="field-body" />
  348. <tbody valign="top">
  349. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  350. <li><strong>zone</strong> (<em>int</em>) &#8211; The zone to fault.</li>
  351. <li><strong>simulate_wire_problem</strong> (<em>bool</em>) &#8211; Whether or not to simulate a wire fault.</li>
  352. </ul>
  353. </td>
  354. </tr>
  355. </tbody>
  356. </table>
  357. </dd></dl>
  358. <dl class="method">
  359. <dt id="pyad2.ad2.AD2.clear_zone">
  360. <tt class="descname">clear_zone</tt><big>(</big><em>zone</em><big>)</big><a class="reference internal" href="_modules/pyad2/ad2.html#AD2.clear_zone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.ad2.AD2.clear_zone" title="Permalink to this definition">¶</a></dt>
  361. <dd><p>Clears a zone if we are emulating a zone expander.</p>
  362. <table class="docutils field-list" frame="void" rules="none">
  363. <col class="field-name" />
  364. <col class="field-body" />
  365. <tbody valign="top">
  366. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>zone</strong> (<em>int</em>) &#8211; The zone to clear.</td>
  367. </tr>
  368. </tbody>
  369. </table>
  370. </dd></dl>
  371. </dd></dl>
  372. </div>
  373. <div class="section" id="module-pyad2.devices">
  374. <span id="devices-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">devices</span></tt> Module<a class="headerlink" href="#module-pyad2.devices" title="Permalink to this headline">¶</a></h2>
  375. <p>Contains different types of devices belonging to the AD2USB family.</p>
  376. <dl class="class">
  377. <dt id="pyad2.devices.Device">
  378. <em class="property">class </em><tt class="descclassname">pyad2.devices.</tt><tt class="descname">Device</tt><a class="reference internal" href="_modules/pyad2/devices.html#Device"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.Device" title="Permalink to this definition">¶</a></dt>
  379. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  380. <p>Generic parent device to all AD2USB products.</p>
  381. <dl class="attribute">
  382. <dt id="pyad2.devices.Device.on_open">
  383. <tt class="descname">on_open</tt><a class="headerlink" href="#pyad2.devices.Device.on_open" title="Permalink to this definition">¶</a></dt>
  384. <dd><p>Called when the device has been opened</p>
  385. </dd></dl>
  386. <dl class="attribute">
  387. <dt id="pyad2.devices.Device.on_close">
  388. <tt class="descname">on_close</tt><a class="headerlink" href="#pyad2.devices.Device.on_close" title="Permalink to this definition">¶</a></dt>
  389. <dd><p>Called when the device has been closed</p>
  390. </dd></dl>
  391. <dl class="attribute">
  392. <dt id="pyad2.devices.Device.on_read">
  393. <tt class="descname">on_read</tt><a class="headerlink" href="#pyad2.devices.Device.on_read" title="Permalink to this definition">¶</a></dt>
  394. <dd><p>Called when a line has been read from the device</p>
  395. </dd></dl>
  396. <dl class="attribute">
  397. <dt id="pyad2.devices.Device.on_write">
  398. <tt class="descname">on_write</tt><a class="headerlink" href="#pyad2.devices.Device.on_write" title="Permalink to this definition">¶</a></dt>
  399. <dd><p>Called when data has been written to the device</p>
  400. </dd></dl>
  401. <dl class="attribute">
  402. <dt id="pyad2.devices.Device.id">
  403. <tt class="descname">id</tt><a class="reference internal" href="_modules/pyad2/devices.html#Device.id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.Device.id" title="Permalink to this definition">¶</a></dt>
  404. <dd><p>Retrieve the device ID.</p>
  405. <table class="docutils field-list" frame="void" rules="none">
  406. <col class="field-name" />
  407. <col class="field-body" />
  408. <tbody valign="top">
  409. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The identification string for the device.</td>
  410. </tr>
  411. </tbody>
  412. </table>
  413. </dd></dl>
  414. <dl class="method">
  415. <dt id="pyad2.devices.Device.is_reader_alive">
  416. <tt class="descname">is_reader_alive</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#Device.is_reader_alive"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.Device.is_reader_alive" title="Permalink to this definition">¶</a></dt>
  417. <dd><p>Indicates whether or not the reader thread is alive.</p>
  418. <table class="docutils field-list" frame="void" rules="none">
  419. <col class="field-name" />
  420. <col class="field-body" />
  421. <tbody valign="top">
  422. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Whether or not the reader thread is alive.</td>
  423. </tr>
  424. </tbody>
  425. </table>
  426. </dd></dl>
  427. <dl class="method">
  428. <dt id="pyad2.devices.Device.stop_reader">
  429. <tt class="descname">stop_reader</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#Device.stop_reader"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.Device.stop_reader" title="Permalink to this definition">¶</a></dt>
  430. <dd><p>Stops the reader thread.</p>
  431. </dd></dl>
  432. <dl class="method">
  433. <dt id="pyad2.devices.Device.close">
  434. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#Device.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.Device.close" title="Permalink to this definition">¶</a></dt>
  435. <dd><p>Closes the device.</p>
  436. </dd></dl>
  437. <dl class="class">
  438. <dt id="pyad2.devices.Device.ReadThread">
  439. <em class="property">class </em><tt class="descname">ReadThread</tt><big>(</big><em>device</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#Device.ReadThread"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.Device.ReadThread" title="Permalink to this definition">¶</a></dt>
  440. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">threading.Thread</span></tt></p>
  441. <p>Reader thread which processes messages from the device.</p>
  442. <dl class="attribute">
  443. <dt id="pyad2.devices.Device.ReadThread.READ_TIMEOUT">
  444. <tt class="descname">READ_TIMEOUT</tt><em class="property"> = 10</em><a class="headerlink" href="#pyad2.devices.Device.ReadThread.READ_TIMEOUT" title="Permalink to this definition">¶</a></dt>
  445. <dd><p>Timeout for the reader thread.</p>
  446. </dd></dl>
  447. <dl class="method">
  448. <dt id="pyad2.devices.Device.ReadThread.stop">
  449. <tt class="descname">stop</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#Device.ReadThread.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.Device.ReadThread.stop" title="Permalink to this definition">¶</a></dt>
  450. <dd><p>Stops the running thread.</p>
  451. </dd></dl>
  452. <dl class="method">
  453. <dt id="pyad2.devices.Device.ReadThread.run">
  454. <tt class="descname">run</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#Device.ReadThread.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.Device.ReadThread.run" title="Permalink to this definition">¶</a></dt>
  455. <dd><p>The actual read process.</p>
  456. </dd></dl>
  457. </dd></dl>
  458. </dd></dl>
  459. <dl class="class">
  460. <dt id="pyad2.devices.USBDevice">
  461. <em class="property">class </em><tt class="descclassname">pyad2.devices.</tt><tt class="descname">USBDevice</tt><big>(</big><em>interface=(None</em>, <em>0)</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#USBDevice"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.USBDevice" title="Permalink to this definition">¶</a></dt>
  462. <dd><p>Bases: <a class="reference internal" href="#pyad2.devices.Device" title="pyad2.devices.Device"><tt class="xref py py-class docutils literal"><span class="pre">pyad2.devices.Device</span></tt></a></p>
  463. <p>AD2USB device exposed with PyFTDI&#8217;s interface.</p>
  464. <dl class="attribute">
  465. <dt id="pyad2.devices.USBDevice.FTDI_VENDOR_ID">
  466. <tt class="descname">FTDI_VENDOR_ID</tt><em class="property"> = 1027</em><a class="headerlink" href="#pyad2.devices.USBDevice.FTDI_VENDOR_ID" title="Permalink to this definition">¶</a></dt>
  467. <dd><p>Vendor ID used to recognize AD2USB devices.</p>
  468. </dd></dl>
  469. <dl class="attribute">
  470. <dt id="pyad2.devices.USBDevice.FTDI_PRODUCT_ID">
  471. <tt class="descname">FTDI_PRODUCT_ID</tt><em class="property"> = 24577</em><a class="headerlink" href="#pyad2.devices.USBDevice.FTDI_PRODUCT_ID" title="Permalink to this definition">¶</a></dt>
  472. <dd><p>Product ID used to recognize AD2USB devices.</p>
  473. </dd></dl>
  474. <dl class="attribute">
  475. <dt id="pyad2.devices.USBDevice.BAUDRATE">
  476. <tt class="descname">BAUDRATE</tt><em class="property"> = 115200</em><a class="headerlink" href="#pyad2.devices.USBDevice.BAUDRATE" title="Permalink to this definition">¶</a></dt>
  477. <dd><p>Default baudrate for AD2USB devices.</p>
  478. </dd></dl>
  479. <dl class="staticmethod">
  480. <dt id="pyad2.devices.USBDevice.find_all">
  481. <em class="property">static </em><tt class="descname">find_all</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#USBDevice.find_all"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.USBDevice.find_all" title="Permalink to this definition">¶</a></dt>
  482. <dd><p>Returns all FTDI devices matching our vendor and product IDs.</p>
  483. <table class="docutils field-list" frame="void" rules="none">
  484. <col class="field-name" />
  485. <col class="field-body" />
  486. <tbody valign="top">
  487. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">list of devices</td>
  488. </tr>
  489. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body">util.CommError</td>
  490. </tr>
  491. </tbody>
  492. </table>
  493. </dd></dl>
  494. <dl class="attribute">
  495. <dt id="pyad2.devices.USBDevice.interface">
  496. <tt class="descname">interface</tt><a class="reference internal" href="_modules/pyad2/devices.html#USBDevice.interface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.USBDevice.interface" title="Permalink to this definition">¶</a></dt>
  497. <dd><p>Retrieves the interface used to connect to the device.</p>
  498. <table class="docutils field-list" frame="void" rules="none">
  499. <col class="field-name" />
  500. <col class="field-body" />
  501. <tbody valign="top">
  502. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">the interface used to connect to the device.</td>
  503. </tr>
  504. </tbody>
  505. </table>
  506. </dd></dl>
  507. <dl class="attribute">
  508. <dt id="pyad2.devices.USBDevice.serial_number">
  509. <tt class="descname">serial_number</tt><a class="reference internal" href="_modules/pyad2/devices.html#USBDevice.serial_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.USBDevice.serial_number" title="Permalink to this definition">¶</a></dt>
  510. <dd><p>Retrieves the serial number of the device.</p>
  511. <table class="docutils field-list" frame="void" rules="none">
  512. <col class="field-name" />
  513. <col class="field-body" />
  514. <tbody valign="top">
  515. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The serial number of the device.</td>
  516. </tr>
  517. </tbody>
  518. </table>
  519. </dd></dl>
  520. <dl class="attribute">
  521. <dt id="pyad2.devices.USBDevice.description">
  522. <tt class="descname">description</tt><a class="reference internal" href="_modules/pyad2/devices.html#USBDevice.description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.USBDevice.description" title="Permalink to this definition">¶</a></dt>
  523. <dd><p>Retrieves the description of the device.</p>
  524. <table class="docutils field-list" frame="void" rules="none">
  525. <col class="field-name" />
  526. <col class="field-body" />
  527. <tbody valign="top">
  528. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The description of the device.</td>
  529. </tr>
  530. </tbody>
  531. </table>
  532. </dd></dl>
  533. <dl class="method">
  534. <dt id="pyad2.devices.USBDevice.open">
  535. <tt class="descname">open</tt><big>(</big><em>baudrate=115200</em>, <em>no_reader_thread=False</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#USBDevice.open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.USBDevice.open" title="Permalink to this definition">¶</a></dt>
  536. <dd><p>Opens the device.</p>
  537. <table class="docutils field-list" frame="void" rules="none">
  538. <col class="field-name" />
  539. <col class="field-body" />
  540. <tbody valign="top">
  541. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  542. <li><strong>baudrate</strong> (<em>int</em>) &#8211; The baudrate to use.</li>
  543. <li><strong>no_reader_thread</strong> (<em>bool</em>) &#8211; Whether or not to automatically start the reader thread.</li>
  544. </ul>
  545. </td>
  546. </tr>
  547. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last">util.NoDeviceError</p>
  548. </td>
  549. </tr>
  550. </tbody>
  551. </table>
  552. </dd></dl>
  553. <dl class="method">
  554. <dt id="pyad2.devices.USBDevice.close">
  555. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#USBDevice.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.USBDevice.close" title="Permalink to this definition">¶</a></dt>
  556. <dd><p>Closes the device.</p>
  557. </dd></dl>
  558. <dl class="method">
  559. <dt id="pyad2.devices.USBDevice.write">
  560. <tt class="descname">write</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#USBDevice.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.USBDevice.write" title="Permalink to this definition">¶</a></dt>
  561. <dd><p>Writes data to the device.</p>
  562. <table class="docutils field-list" frame="void" rules="none">
  563. <col class="field-name" />
  564. <col class="field-body" />
  565. <tbody valign="top">
  566. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>str</em>) &#8211; Data to write</td>
  567. </tr>
  568. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body">util.CommError</td>
  569. </tr>
  570. </tbody>
  571. </table>
  572. </dd></dl>
  573. <dl class="method">
  574. <dt id="pyad2.devices.USBDevice.read">
  575. <tt class="descname">read</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#USBDevice.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.USBDevice.read" title="Permalink to this definition">¶</a></dt>
  576. <dd><p>Reads a single character from the device.</p>
  577. <table class="docutils field-list" frame="void" rules="none">
  578. <col class="field-name" />
  579. <col class="field-body" />
  580. <tbody valign="top">
  581. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The character read from the device.</td>
  582. </tr>
  583. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body">util.CommError</td>
  584. </tr>
  585. </tbody>
  586. </table>
  587. </dd></dl>
  588. <dl class="method">
  589. <dt id="pyad2.devices.USBDevice.read_line">
  590. <tt class="descname">read_line</tt><big>(</big><em>timeout=0.0</em>, <em>purge_buffer=False</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#USBDevice.read_line"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.USBDevice.read_line" title="Permalink to this definition">¶</a></dt>
  591. <dd><p>Reads a line from the device.</p>
  592. <table class="docutils field-list" frame="void" rules="none">
  593. <col class="field-name" />
  594. <col class="field-body" />
  595. <tbody valign="top">
  596. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  597. <li><strong>timeout</strong> (<em>float</em>) &#8211; Read timeout</li>
  598. <li><strong>purge_buffer</strong> (<em>bool</em>) &#8211; Indicates whether to purge the buffer prior to reading.</li>
  599. </ul>
  600. </td>
  601. </tr>
  602. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The line that was read.</p>
  603. </td>
  604. </tr>
  605. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last">util.CommError, util.TimeoutError</p>
  606. </td>
  607. </tr>
  608. </tbody>
  609. </table>
  610. </dd></dl>
  611. </dd></dl>
  612. <dl class="class">
  613. <dt id="pyad2.devices.SerialDevice">
  614. <em class="property">class </em><tt class="descclassname">pyad2.devices.</tt><tt class="descname">SerialDevice</tt><big>(</big><em>interface=None</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SerialDevice"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SerialDevice" title="Permalink to this definition">¶</a></dt>
  615. <dd><p>Bases: <a class="reference internal" href="#pyad2.devices.Device" title="pyad2.devices.Device"><tt class="xref py py-class docutils literal"><span class="pre">pyad2.devices.Device</span></tt></a></p>
  616. <p>AD2USB or AD2SERIAL device exposed with the pyserial interface.</p>
  617. <dl class="attribute">
  618. <dt id="pyad2.devices.SerialDevice.BAUDRATE">
  619. <tt class="descname">BAUDRATE</tt><em class="property"> = 19200</em><a class="headerlink" href="#pyad2.devices.SerialDevice.BAUDRATE" title="Permalink to this definition">¶</a></dt>
  620. <dd><p>Default baudrate for Serial devices.</p>
  621. </dd></dl>
  622. <dl class="staticmethod">
  623. <dt id="pyad2.devices.SerialDevice.find_all">
  624. <em class="property">static </em><tt class="descname">find_all</tt><big>(</big><em>pattern=None</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SerialDevice.find_all"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SerialDevice.find_all" title="Permalink to this definition">¶</a></dt>
  625. <dd><p>Returns all serial ports present.</p>
  626. <table class="docutils field-list" frame="void" rules="none">
  627. <col class="field-name" />
  628. <col class="field-body" />
  629. <tbody valign="top">
  630. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>pattern</strong> (<em>str</em>) &#8211; Pattern to search for when retrieving serial ports.</td>
  631. </tr>
  632. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of devices</td>
  633. </tr>
  634. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body">util.CommError</td>
  635. </tr>
  636. </tbody>
  637. </table>
  638. </dd></dl>
  639. <dl class="attribute">
  640. <dt id="pyad2.devices.SerialDevice.interface">
  641. <tt class="descname">interface</tt><a class="reference internal" href="_modules/pyad2/devices.html#SerialDevice.interface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SerialDevice.interface" title="Permalink to this definition">¶</a></dt>
  642. <dd><p>Retrieves the interface used to connect to the device.</p>
  643. <table class="docutils field-list" frame="void" rules="none">
  644. <col class="field-name" />
  645. <col class="field-body" />
  646. <tbody valign="top">
  647. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">the interface used to connect to the device.</td>
  648. </tr>
  649. </tbody>
  650. </table>
  651. </dd></dl>
  652. <dl class="method">
  653. <dt id="pyad2.devices.SerialDevice.open">
  654. <tt class="descname">open</tt><big>(</big><em>baudrate=19200</em>, <em>no_reader_thread=False</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SerialDevice.open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SerialDevice.open" title="Permalink to this definition">¶</a></dt>
  655. <dd><p>Opens the device.</p>
  656. <table class="docutils field-list" frame="void" rules="none">
  657. <col class="field-name" />
  658. <col class="field-body" />
  659. <tbody valign="top">
  660. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  661. <li><strong>baudrate</strong> (<em>int</em>) &#8211; The baudrate to use with the device.</li>
  662. <li><strong>no_reader_thread</strong> (<em>bool</em>) &#8211; Whether or not to automatically start the reader thread.</li>
  663. </ul>
  664. </td>
  665. </tr>
  666. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last">util.NoDeviceError</p>
  667. </td>
  668. </tr>
  669. </tbody>
  670. </table>
  671. </dd></dl>
  672. <dl class="method">
  673. <dt id="pyad2.devices.SerialDevice.close">
  674. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SerialDevice.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SerialDevice.close" title="Permalink to this definition">¶</a></dt>
  675. <dd><p>Closes the device.</p>
  676. </dd></dl>
  677. <dl class="method">
  678. <dt id="pyad2.devices.SerialDevice.write">
  679. <tt class="descname">write</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SerialDevice.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SerialDevice.write" title="Permalink to this definition">¶</a></dt>
  680. <dd><p>Writes data to the device.</p>
  681. <table class="docutils field-list" frame="void" rules="none">
  682. <col class="field-name" />
  683. <col class="field-body" />
  684. <tbody valign="top">
  685. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>str</em>) &#8211; The data to write.</td>
  686. </tr>
  687. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body">util.CommError</td>
  688. </tr>
  689. </tbody>
  690. </table>
  691. </dd></dl>
  692. <dl class="method">
  693. <dt id="pyad2.devices.SerialDevice.read">
  694. <tt class="descname">read</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SerialDevice.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SerialDevice.read" title="Permalink to this definition">¶</a></dt>
  695. <dd><p>Reads a single character from the device.</p>
  696. <table class="docutils field-list" frame="void" rules="none">
  697. <col class="field-name" />
  698. <col class="field-body" />
  699. <tbody valign="top">
  700. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The character read from the device.</td>
  701. </tr>
  702. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body">util.CommError</td>
  703. </tr>
  704. </tbody>
  705. </table>
  706. </dd></dl>
  707. <dl class="method">
  708. <dt id="pyad2.devices.SerialDevice.read_line">
  709. <tt class="descname">read_line</tt><big>(</big><em>timeout=0.0</em>, <em>purge_buffer=False</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SerialDevice.read_line"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SerialDevice.read_line" title="Permalink to this definition">¶</a></dt>
  710. <dd><p>Reads a line from the device.</p>
  711. <table class="docutils field-list" frame="void" rules="none">
  712. <col class="field-name" />
  713. <col class="field-body" />
  714. <tbody valign="top">
  715. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  716. <li><strong>timeout</strong> (<em>float</em>) &#8211; The read timeout.</li>
  717. <li><strong>purge_buffer</strong> (<em>bool</em>) &#8211; Indicates whether to purge the buffer prior to reading.</li>
  718. </ul>
  719. </td>
  720. </tr>
  721. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The line read.</p>
  722. </td>
  723. </tr>
  724. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last">util.CommError, util.TimeoutError</p>
  725. </td>
  726. </tr>
  727. </tbody>
  728. </table>
  729. </dd></dl>
  730. </dd></dl>
  731. <dl class="class">
  732. <dt id="pyad2.devices.SocketDevice">
  733. <em class="property">class </em><tt class="descclassname">pyad2.devices.</tt><tt class="descname">SocketDevice</tt><big>(</big><em>interface=('localhost'</em>, <em>10000)</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice" title="Permalink to this definition">¶</a></dt>
  734. <dd><p>Bases: <a class="reference internal" href="#pyad2.devices.Device" title="pyad2.devices.Device"><tt class="xref py py-class docutils literal"><span class="pre">pyad2.devices.Device</span></tt></a></p>
  735. <p>Device that supports communication with an AD2USB that is exposed via ser2sock or another
  736. Serial to IP interface.</p>
  737. <dl class="attribute">
  738. <dt id="pyad2.devices.SocketDevice.interface">
  739. <tt class="descname">interface</tt><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice.interface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice.interface" title="Permalink to this definition">¶</a></dt>
  740. <dd><p>Retrieves the interface used to connect to the device.</p>
  741. <table class="docutils field-list" frame="void" rules="none">
  742. <col class="field-name" />
  743. <col class="field-body" />
  744. <tbody valign="top">
  745. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">the interface used to connect to the device.</td>
  746. </tr>
  747. </tbody>
  748. </table>
  749. </dd></dl>
  750. <dl class="attribute">
  751. <dt id="pyad2.devices.SocketDevice.ssl">
  752. <tt class="descname">ssl</tt><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice.ssl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice.ssl" title="Permalink to this definition">¶</a></dt>
  753. <dd><p>Retrieves whether or not the device is using SSL.</p>
  754. <table class="docutils field-list" frame="void" rules="none">
  755. <col class="field-name" />
  756. <col class="field-body" />
  757. <tbody valign="top">
  758. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Whether or not the device is using SSL.</td>
  759. </tr>
  760. </tbody>
  761. </table>
  762. </dd></dl>
  763. <dl class="attribute">
  764. <dt id="pyad2.devices.SocketDevice.ssl_certificate">
  765. <tt class="descname">ssl_certificate</tt><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice.ssl_certificate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice.ssl_certificate" title="Permalink to this definition">¶</a></dt>
  766. <dd><p>Retrieves the SSL client certificate path used for authentication.</p>
  767. <table class="docutils field-list" frame="void" rules="none">
  768. <col class="field-name" />
  769. <col class="field-body" />
  770. <tbody valign="top">
  771. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The certificate path</td>
  772. </tr>
  773. </tbody>
  774. </table>
  775. </dd></dl>
  776. <dl class="attribute">
  777. <dt id="pyad2.devices.SocketDevice.ssl_key">
  778. <tt class="descname">ssl_key</tt><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice.ssl_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice.ssl_key" title="Permalink to this definition">¶</a></dt>
  779. <dd><p>Retrieves the SSL client certificate key used for authentication.</p>
  780. <table class="docutils field-list" frame="void" rules="none">
  781. <col class="field-name" />
  782. <col class="field-body" />
  783. <tbody valign="top">
  784. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The key path</td>
  785. </tr>
  786. </tbody>
  787. </table>
  788. </dd></dl>
  789. <dl class="attribute">
  790. <dt id="pyad2.devices.SocketDevice.ssl_ca">
  791. <tt class="descname">ssl_ca</tt><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice.ssl_ca"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice.ssl_ca" title="Permalink to this definition">¶</a></dt>
  792. <dd><p>Retrieves the SSL Certificate Authority certificate used for authentication.</p>
  793. <table class="docutils field-list" frame="void" rules="none">
  794. <col class="field-name" />
  795. <col class="field-body" />
  796. <tbody valign="top">
  797. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The CA path</td>
  798. </tr>
  799. </tbody>
  800. </table>
  801. </dd></dl>
  802. <dl class="method">
  803. <dt id="pyad2.devices.SocketDevice.open">
  804. <tt class="descname">open</tt><big>(</big><em>baudrate=None</em>, <em>no_reader_thread=False</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice.open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice.open" title="Permalink to this definition">¶</a></dt>
  805. <dd><p>Opens the device.</p>
  806. <table class="docutils field-list" frame="void" rules="none">
  807. <col class="field-name" />
  808. <col class="field-body" />
  809. <tbody valign="top">
  810. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  811. <li><strong>baudrate</strong> (<em>int</em>) &#8211; The baudrate to use</li>
  812. <li><strong>no_reader_thread</strong> (<em>bool</em>) &#8211; Whether or not to automatically open the reader thread.</li>
  813. </ul>
  814. </td>
  815. </tr>
  816. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last">util.NoDeviceError, util.CommError</p>
  817. </td>
  818. </tr>
  819. </tbody>
  820. </table>
  821. </dd></dl>
  822. <dl class="method">
  823. <dt id="pyad2.devices.SocketDevice.close">
  824. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice.close" title="Permalink to this definition">¶</a></dt>
  825. <dd><p>Closes the device.</p>
  826. </dd></dl>
  827. <dl class="method">
  828. <dt id="pyad2.devices.SocketDevice.write">
  829. <tt class="descname">write</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice.write" title="Permalink to this definition">¶</a></dt>
  830. <dd><p>Writes data to the device.</p>
  831. <table class="docutils field-list" frame="void" rules="none">
  832. <col class="field-name" />
  833. <col class="field-body" />
  834. <tbody valign="top">
  835. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>str</em>) &#8211; The data to write.</td>
  836. </tr>
  837. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The number of bytes sent.</td>
  838. </tr>
  839. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body">util.CommError</td>
  840. </tr>
  841. </tbody>
  842. </table>
  843. </dd></dl>
  844. <dl class="method">
  845. <dt id="pyad2.devices.SocketDevice.read">
  846. <tt class="descname">read</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice.read" title="Permalink to this definition">¶</a></dt>
  847. <dd><p>Reads a single character from the device.</p>
  848. <table class="docutils field-list" frame="void" rules="none">
  849. <col class="field-name" />
  850. <col class="field-body" />
  851. <tbody valign="top">
  852. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The character read from the device.</td>
  853. </tr>
  854. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body">util.CommError</td>
  855. </tr>
  856. </tbody>
  857. </table>
  858. </dd></dl>
  859. <dl class="method">
  860. <dt id="pyad2.devices.SocketDevice.read_line">
  861. <tt class="descname">read_line</tt><big>(</big><em>timeout=0.0</em>, <em>purge_buffer=False</em><big>)</big><a class="reference internal" href="_modules/pyad2/devices.html#SocketDevice.read_line"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.devices.SocketDevice.read_line" title="Permalink to this definition">¶</a></dt>
  862. <dd><p>Reads a line from the device.</p>
  863. <table class="docutils field-list" frame="void" rules="none">
  864. <col class="field-name" />
  865. <col class="field-body" />
  866. <tbody valign="top">
  867. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  868. <li><strong>timeout</strong> (<em>float</em>) &#8211; The read timeout.</li>
  869. <li><strong>purge_buffer</strong> (<em>bool</em>) &#8211; Indicates whether to purge the buffer prior to reading.</li>
  870. </ul>
  871. </td>
  872. </tr>
  873. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The line read from the device.</p>
  874. </td>
  875. </tr>
  876. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last">util.CommError, util.TimeoutError</p>
  877. </td>
  878. </tr>
  879. </tbody>
  880. </table>
  881. </dd></dl>
  882. </dd></dl>
  883. </div>
  884. <div class="section" id="module-pyad2.util">
  885. <span id="util-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">util</span></tt> Module<a class="headerlink" href="#module-pyad2.util" title="Permalink to this headline">¶</a></h2>
  886. <p>Provides utility classes for the AD2USB devices.</p>
  887. <dl class="exception">
  888. <dt id="pyad2.util.NoDeviceError">
  889. <em class="property">exception </em><tt class="descclassname">pyad2.util.</tt><tt class="descname">NoDeviceError</tt><a class="reference internal" href="_modules/pyad2/util.html#NoDeviceError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.util.NoDeviceError" title="Permalink to this definition">¶</a></dt>
  890. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
  891. <p>No devices found.</p>
  892. </dd></dl>
  893. <dl class="exception">
  894. <dt id="pyad2.util.CommError">
  895. <em class="property">exception </em><tt class="descclassname">pyad2.util.</tt><tt class="descname">CommError</tt><a class="reference internal" href="_modules/pyad2/util.html#CommError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.util.CommError" title="Permalink to this definition">¶</a></dt>
  896. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
  897. <p>There was an error communicating with the device.</p>
  898. </dd></dl>
  899. <dl class="exception">
  900. <dt id="pyad2.util.TimeoutError">
  901. <em class="property">exception </em><tt class="descclassname">pyad2.util.</tt><tt class="descname">TimeoutError</tt><a class="reference internal" href="_modules/pyad2/util.html#TimeoutError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.util.TimeoutError" title="Permalink to this definition">¶</a></dt>
  902. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
  903. <p>There was a timeout while trying to communicate with the device.</p>
  904. </dd></dl>
  905. <dl class="exception">
  906. <dt id="pyad2.util.InvalidMessageError">
  907. <em class="property">exception </em><tt class="descclassname">pyad2.util.</tt><tt class="descname">InvalidMessageError</tt><a class="reference internal" href="_modules/pyad2/util.html#InvalidMessageError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.util.InvalidMessageError" title="Permalink to this definition">¶</a></dt>
  908. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
  909. <p>The format of the panel message was invalid.</p>
  910. </dd></dl>
  911. <dl class="class">
  912. <dt id="pyad2.util.Firmware">
  913. <em class="property">class </em><tt class="descclassname">pyad2.util.</tt><tt class="descname">Firmware</tt><a class="reference internal" href="_modules/pyad2/util.html#Firmware"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.util.Firmware" title="Permalink to this definition">¶</a></dt>
  914. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  915. <p>Represents firmware for the AD2USB/AD2SERIAL devices.</p>
  916. <dl class="attribute">
  917. <dt id="pyad2.util.Firmware.STAGE_START">
  918. <tt class="descname">STAGE_START</tt><em class="property"> = 0</em><a class="headerlink" href="#pyad2.util.Firmware.STAGE_START" title="Permalink to this definition">¶</a></dt>
  919. <dd></dd></dl>
  920. <dl class="attribute">
  921. <dt id="pyad2.util.Firmware.STAGE_WAITING">
  922. <tt class="descname">STAGE_WAITING</tt><em class="property"> = 1</em><a class="headerlink" href="#pyad2.util.Firmware.STAGE_WAITING" title="Permalink to this definition">¶</a></dt>
  923. <dd></dd></dl>
  924. <dl class="attribute">
  925. <dt id="pyad2.util.Firmware.STAGE_BOOT">
  926. <tt class="descname">STAGE_BOOT</tt><em class="property"> = 2</em><a class="headerlink" href="#pyad2.util.Firmware.STAGE_BOOT" title="Permalink to this definition">¶</a></dt>
  927. <dd></dd></dl>
  928. <dl class="attribute">
  929. <dt id="pyad2.util.Firmware.STAGE_LOAD">
  930. <tt class="descname">STAGE_LOAD</tt><em class="property"> = 3</em><a class="headerlink" href="#pyad2.util.Firmware.STAGE_LOAD" title="Permalink to this definition">¶</a></dt>
  931. <dd></dd></dl>
  932. <dl class="attribute">
  933. <dt id="pyad2.util.Firmware.STAGE_UPLOADING">
  934. <tt class="descname">STAGE_UPLOADING</tt><em class="property"> = 4</em><a class="headerlink" href="#pyad2.util.Firmware.STAGE_UPLOADING" title="Permalink to this definition">¶</a></dt>
  935. <dd></dd></dl>
  936. <dl class="attribute">
  937. <dt id="pyad2.util.Firmware.STAGE_DONE">
  938. <tt class="descname">STAGE_DONE</tt><em class="property"> = 5</em><a class="headerlink" href="#pyad2.util.Firmware.STAGE_DONE" title="Permalink to this definition">¶</a></dt>
  939. <dd></dd></dl>
  940. <dl class="staticmethod">
  941. <dt id="pyad2.util.Firmware.upload">
  942. <em class="property">static </em><tt class="descname">upload</tt><big>(</big><em>dev</em>, <em>filename</em>, <em>progress_callback=None</em><big>)</big><a class="reference internal" href="_modules/pyad2/util.html#Firmware.upload"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.util.Firmware.upload" title="Permalink to this definition">¶</a></dt>
  943. <dd><p>Uploads firmware to an AD2USB/AD2SERIAL device.</p>
  944. <table class="docutils field-list" frame="void" rules="none">
  945. <col class="field-name" />
  946. <col class="field-body" />
  947. <tbody valign="top">
  948. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  949. <li><strong>filename</strong> (<em>str</em>) &#8211; The firmware filename</li>
  950. <li><strong>progress_callback</strong> (<em>function</em>) &#8211; Callback function used to report progress.</li>
  951. </ul>
  952. </td>
  953. </tr>
  954. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last">util.NoDeviceError, util.TimeoutError</p>
  955. </td>
  956. </tr>
  957. </tbody>
  958. </table>
  959. </dd></dl>
  960. </dd></dl>
  961. </div>
  962. <div class="section" id="module-pyad2.zonetracking">
  963. <span id="zonetracking-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">zonetracking</span></tt> Module<a class="headerlink" href="#module-pyad2.zonetracking" title="Permalink to this headline">¶</a></h2>
  964. <p>Provides zone tracking functionality for the AD2USB device family.</p>
  965. <dl class="class">
  966. <dt id="pyad2.zonetracking.Zone">
  967. <em class="property">class </em><tt class="descclassname">pyad2.zonetracking.</tt><tt class="descname">Zone</tt><big>(</big><em>zone=0</em>, <em>name=''</em>, <em>status=0</em><big>)</big><a class="reference internal" href="_modules/pyad2/zonetracking.html#Zone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.zonetracking.Zone" title="Permalink to this definition">¶</a></dt>
  968. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  969. <p>Representation of a panel zone.</p>
  970. <dl class="attribute">
  971. <dt id="pyad2.zonetracking.Zone.CLEAR">
  972. <tt class="descname">CLEAR</tt><em class="property"> = 0</em><a class="headerlink" href="#pyad2.zonetracking.Zone.CLEAR" title="Permalink to this definition">¶</a></dt>
  973. <dd><p>Status indicating that the zone is cleared.</p>
  974. </dd></dl>
  975. <dl class="attribute">
  976. <dt id="pyad2.zonetracking.Zone.FAULT">
  977. <tt class="descname">FAULT</tt><em class="property"> = 1</em><a class="headerlink" href="#pyad2.zonetracking.Zone.FAULT" title="Permalink to this definition">¶</a></dt>
  978. <dd><p>Status indicating that the zone is faulted.</p>
  979. </dd></dl>
  980. <dl class="attribute">
  981. <dt id="pyad2.zonetracking.Zone.CHECK">
  982. <tt class="descname">CHECK</tt><em class="property"> = 2</em><a class="headerlink" href="#pyad2.zonetracking.Zone.CHECK" title="Permalink to this definition">¶</a></dt>
  983. <dd><p>Status indicating that there is a wiring issue with the zone.</p>
  984. </dd></dl>
  985. <dl class="attribute">
  986. <dt id="pyad2.zonetracking.Zone.STATUS">
  987. <tt class="descname">STATUS</tt><em class="property"> = {0: 'CLEAR', 1: 'FAULT', 2: 'CHECK'}</em><a class="headerlink" href="#pyad2.zonetracking.Zone.STATUS" title="Permalink to this definition">¶</a></dt>
  988. <dd></dd></dl>
  989. </dd></dl>
  990. <dl class="class">
  991. <dt id="pyad2.zonetracking.Zonetracker">
  992. <em class="property">class </em><tt class="descclassname">pyad2.zonetracking.</tt><tt class="descname">Zonetracker</tt><a class="reference internal" href="_modules/pyad2/zonetracking.html#Zonetracker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.zonetracking.Zonetracker" title="Permalink to this definition">¶</a></dt>
  993. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  994. <p>Handles tracking of zone and their statuses.</p>
  995. <dl class="attribute">
  996. <dt id="pyad2.zonetracking.Zonetracker.on_fault">
  997. <tt class="descname">on_fault</tt><a class="headerlink" href="#pyad2.zonetracking.Zonetracker.on_fault" title="Permalink to this definition">¶</a></dt>
  998. <dd><p>Called when the device detects a zone fault.</p>
  999. </dd></dl>
  1000. <dl class="attribute">
  1001. <dt id="pyad2.zonetracking.Zonetracker.on_restore">
  1002. <tt class="descname">on_restore</tt><a class="headerlink" href="#pyad2.zonetracking.Zonetracker.on_restore" title="Permalink to this definition">¶</a></dt>
  1003. <dd><p>Called when the device detects that a fault is restored.</p>
  1004. </dd></dl>
  1005. <dl class="attribute">
  1006. <dt id="pyad2.zonetracking.Zonetracker.EXPIRE">
  1007. <tt class="descname">EXPIRE</tt><em class="property"> = 30</em><a class="headerlink" href="#pyad2.zonetracking.Zonetracker.EXPIRE" title="Permalink to this definition">¶</a></dt>
  1008. <dd><p>Zone expiration timeout.</p>
  1009. </dd></dl>
  1010. <dl class="method">
  1011. <dt id="pyad2.zonetracking.Zonetracker.update">
  1012. <tt class="descname">update</tt><big>(</big><em>message</em><big>)</big><a class="reference internal" href="_modules/pyad2/zonetracking.html#Zonetracker.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.zonetracking.Zonetracker.update" title="Permalink to this definition">¶</a></dt>
  1013. <dd><p>Update zone statuses based on the current message.</p>
  1014. <table class="docutils field-list" frame="void" rules="none">
  1015. <col class="field-name" />
  1016. <col class="field-body" />
  1017. <tbody valign="top">
  1018. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>message</strong> (<em>Message or ExpanderMessage</em>) &#8211; Message to use to update the zone tracking.</td>
  1019. </tr>
  1020. </tbody>
  1021. </table>
  1022. </dd></dl>
  1023. </dd></dl>
  1024. </div>
  1025. <div class="section" id="module-pyad2.panels">
  1026. <span id="panels-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">panels</span></tt> Module<a class="headerlink" href="#module-pyad2.panels" title="Permalink to this headline">¶</a></h2>
  1027. <p>Representations of Panels and their templates.</p>
  1028. </div>
  1029. <div class="section" id="module-pyad2.messages">
  1030. <span id="messages-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">messages</span></tt> Module<a class="headerlink" href="#module-pyad2.messages" title="Permalink to this headline">¶</a></h2>
  1031. <p>Message representations received from the panel through the AD2USB.</p>
  1032. <dl class="class">
  1033. <dt id="pyad2.messages.BaseMessage">
  1034. <em class="property">class </em><tt class="descclassname">pyad2.messages.</tt><tt class="descname">BaseMessage</tt><a class="reference internal" href="_modules/pyad2/messages.html#BaseMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.messages.BaseMessage" title="Permalink to this definition">¶</a></dt>
  1035. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  1036. <p>Base class for messages.</p>
  1037. </dd></dl>
  1038. <dl class="class">
  1039. <dt id="pyad2.messages.Message">
  1040. <em class="property">class </em><tt class="descclassname">pyad2.messages.</tt><tt class="descname">Message</tt><big>(</big><em>data=None</em><big>)</big><a class="reference internal" href="_modules/pyad2/messages.html#Message"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.messages.Message" title="Permalink to this definition">¶</a></dt>
  1041. <dd><p>Bases: <a class="reference internal" href="#pyad2.messages.BaseMessage" title="pyad2.messages.BaseMessage"><tt class="xref py py-class docutils literal"><span class="pre">pyad2.messages.BaseMessage</span></tt></a></p>
  1042. <p>Represents a message from the alarm panel.</p>
  1043. </dd></dl>
  1044. <dl class="class">
  1045. <dt id="pyad2.messages.ExpanderMessage">
  1046. <em class="property">class </em><tt class="descclassname">pyad2.messages.</tt><tt class="descname">ExpanderMessage</tt><big>(</big><em>data=None</em><big>)</big><a class="reference internal" href="_modules/pyad2/messages.html#ExpanderMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.messages.ExpanderMessage" title="Permalink to this definition">¶</a></dt>
  1047. <dd><p>Bases: <a class="reference internal" href="#pyad2.messages.BaseMessage" title="pyad2.messages.BaseMessage"><tt class="xref py py-class docutils literal"><span class="pre">pyad2.messages.BaseMessage</span></tt></a></p>
  1048. <p>Represents a message from a zone or relay expansion module.</p>
  1049. <dl class="attribute">
  1050. <dt id="pyad2.messages.ExpanderMessage.ZONE">
  1051. <tt class="descname">ZONE</tt><em class="property"> = 0</em><a class="headerlink" href="#pyad2.messages.ExpanderMessage.ZONE" title="Permalink to this definition">¶</a></dt>
  1052. <dd></dd></dl>
  1053. <dl class="attribute">
  1054. <dt id="pyad2.messages.ExpanderMessage.RELAY">
  1055. <tt class="descname">RELAY</tt><em class="property"> = 1</em><a class="headerlink" href="#pyad2.messages.ExpanderMessage.RELAY" title="Permalink to this definition">¶</a></dt>
  1056. <dd></dd></dl>
  1057. </dd></dl>
  1058. <dl class="class">
  1059. <dt id="pyad2.messages.RFMessage">
  1060. <em class="property">class </em><tt class="descclassname">pyad2.messages.</tt><tt class="descname">RFMessage</tt><big>(</big><em>data=None</em><big>)</big><a class="reference internal" href="_modules/pyad2/messages.html#RFMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.messages.RFMessage" title="Permalink to this definition">¶</a></dt>
  1061. <dd><p>Bases: <a class="reference internal" href="#pyad2.messages.BaseMessage" title="pyad2.messages.BaseMessage"><tt class="xref py py-class docutils literal"><span class="pre">pyad2.messages.BaseMessage</span></tt></a></p>
  1062. <p>Represents a message from an RF receiver.</p>
  1063. </dd></dl>
  1064. <dl class="class">
  1065. <dt id="pyad2.messages.LRRMessage">
  1066. <em class="property">class </em><tt class="descclassname">pyad2.messages.</tt><tt class="descname">LRRMessage</tt><big>(</big><em>data=None</em><big>)</big><a class="reference internal" href="_modules/pyad2/messages.html#LRRMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyad2.messages.LRRMessage" title="Permalink to this definition">¶</a></dt>
  1067. <dd><p>Bases: <a class="reference internal" href="#pyad2.messages.BaseMessage" title="pyad2.messages.BaseMessage"><tt class="xref py py-class docutils literal"><span class="pre">pyad2.messages.BaseMessage</span></tt></a></p>
  1068. <p>Represent a message from a Long Range Radio.</p>
  1069. </dd></dl>
  1070. </div>
  1071. <div class="section" id="subpackages">
  1072. <h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline">¶</a></h2>
  1073. <div class="toctree-wrapper compound">
  1074. <ul>
  1075. <li class="toctree-l1"><a class="reference internal" href="pyad2usb.event.html">event Package</a><ul>
  1076. <li class="toctree-l2"><a class="reference internal" href="pyad2usb.event.html#id1"><tt class="docutils literal"><span class="pre">event</span></tt> Package</a></li>
  1077. <li class="toctree-l2"><a class="reference internal" href="pyad2usb.event.html#module-pyad2.event.event"><tt class="docutils literal"><span class="pre">event</span></tt> Module</a></li>
  1078. </ul>
  1079. </li>
  1080. </ul>
  1081. </div>
  1082. </div>
  1083. </div>
  1084. </div>
  1085. </div>
  1086. </div>
  1087. <div class="sphinxsidebar">
  1088. <div class="sphinxsidebarwrapper">
  1089. <h3><a href="index.html">Table Of Contents</a></h3>
  1090. <ul>
  1091. <li><a class="reference internal" href="#">pyad2usb Package</a><ul>
  1092. <li><a class="reference internal" href="#module-pyad2.ad2"><tt class="docutils literal"><span class="pre">ad2</span></tt> Module</a></li>
  1093. <li><a class="reference internal" href="#module-pyad2.devices"><tt class="docutils literal"><span class="pre">devices</span></tt> Module</a></li>
  1094. <li><a class="reference internal" href="#module-pyad2.util"><tt class="docutils literal"><span class="pre">util</span></tt> Module</a></li>
  1095. <li><a class="reference internal" href="#module-pyad2.zonetracking"><tt class="docutils literal"><span class="pre">zonetracking</span></tt> Module</a></li>
  1096. <li><a class="reference internal" href="#module-pyad2.panels"><tt class="docutils literal"><span class="pre">panels</span></tt> Module</a></li>
  1097. <li><a class="reference internal" href="#module-pyad2.messages"><tt class="docutils literal"><span class="pre">messages</span></tt> Module</a></li>
  1098. <li><a class="reference internal" href="#subpackages">Subpackages</a><ul>
  1099. </ul>
  1100. </li>
  1101. </ul>
  1102. </li>
  1103. </ul>
  1104. <h3>This Page</h3>
  1105. <ul class="this-page-menu">
  1106. <li><a href="_sources/pyad2usb.txt"
  1107. rel="nofollow">Show Source</a></li>
  1108. </ul>
  1109. <div id="searchbox" style="display: none">
  1110. <h3>Quick search</h3>
  1111. <form class="search" action="search.html" method="get">
  1112. <input type="text" name="q" />
  1113. <input type="submit" value="Go" />
  1114. <input type="hidden" name="check_keywords" value="yes" />
  1115. <input type="hidden" name="area" value="default" />
  1116. </form>
  1117. <p class="searchtip" style="font-size: 90%">
  1118. Enter search terms or a module, class or function name.
  1119. </p>
  1120. </div>
  1121. <script type="text/javascript">$('#searchbox').show(0);</script>
  1122. </div>
  1123. </div>
  1124. <div class="clearer"></div>
  1125. </div>
  1126. <div class="related">
  1127. <h3>Navigation</h3>
  1128. <ul>
  1129. <li class="right" style="margin-right: 10px">
  1130. <a href="genindex.html" title="General Index"
  1131. >index</a></li>
  1132. <li class="right" >
  1133. <a href="py-modindex.html" title="Python Module Index"
  1134. >modules</a> |</li>
  1135. <li><a href="index.html">pyad2 documentation</a> &raquo;</li>
  1136. </ul>
  1137. </div>
  1138. <div class="footer">
  1139. &copy; Copyright 2013, Author.
  1140. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2b1.
  1141. </div>
  1142. </body>
  1143. </html>