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.

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