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.

1626 lines
102 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>alarmdecoder Package &mdash; alarmdecoder 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="alarmdecoder documentation" href="index.html" />
  22. <link rel="prev" title="Welcome to alarmdecoder’s documentation!" href="index.html" />
  23. </head>
  24. <body>
  25. <div class="related">
  26. <h3>Navigation</h3>
  27. <ul>
  28. <li class="right" style="margin-right: 10px">
  29. <a href="genindex.html" title="General Index"
  30. accesskey="I">index</a></li>
  31. <li class="right" >
  32. <a href="py-modindex.html" title="Python Module Index"
  33. >modules</a> |</li>
  34. <li class="right" >
  35. <a href="index.html" title="Welcome to alarmdecoder’s documentation!"
  36. accesskey="P">previous</a> |</li>
  37. <li><a href="index.html">alarmdecoder documentation</a> &raquo;</li>
  38. </ul>
  39. </div>
  40. <div class="document">
  41. <div class="documentwrapper">
  42. <div class="bodywrapper">
  43. <div class="body">
  44. <div class="section" id="alarmdecoder-package">
  45. <h1>alarmdecoder Package<a class="headerlink" href="#alarmdecoder-package" title="Permalink to this headline">¶</a></h1>
  46. <div class="section" id="module-alarmdecoder.decoder">
  47. <span id="alarmdecoder-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">alarmdecoder</span></tt> Module<a class="headerlink" href="#module-alarmdecoder.decoder" title="Permalink to this headline">¶</a></h2>
  48. <p>Provides the main AlarmDecoder class.</p>
  49. <dl class="class">
  50. <dt id="alarmdecoder.decoder.AlarmDecoder">
  51. <em class="property">class </em><tt class="descclassname">alarmdecoder.decoder.</tt><tt class="descname">AlarmDecoder</tt><big>(</big><em>device</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/decoder.html#AlarmDecoder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder" title="Permalink to this definition">¶</a></dt>
  52. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  53. <p>High-level wrapper around <a class="reference external" href="http://www.alarmdecoder.com">Alarm Decoder</a> (AD2) devices.</p>
  54. <dl class="attribute">
  55. <dt id="alarmdecoder.decoder.AlarmDecoder.on_arm">
  56. <tt class="descname">on_arm</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_arm" title="Permalink to this definition">¶</a></dt>
  57. <dd><p>This event is called when the panel is armed.</p>
  58. </dd></dl>
  59. <dl class="attribute">
  60. <dt id="alarmdecoder.decoder.AlarmDecoder.on_disarm">
  61. <tt class="descname">on_disarm</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_disarm" title="Permalink to this definition">¶</a></dt>
  62. <dd><p>This event is called when the panel is disarmed.</p>
  63. </dd></dl>
  64. <dl class="attribute">
  65. <dt id="alarmdecoder.decoder.AlarmDecoder.on_power_changed">
  66. <tt class="descname">on_power_changed</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_power_changed" title="Permalink to this definition">¶</a></dt>
  67. <dd><p>This event is called when panel power switches between AC and DC.</p>
  68. </dd></dl>
  69. <dl class="attribute">
  70. <dt id="alarmdecoder.decoder.AlarmDecoder.on_alarm">
  71. <tt class="descname">on_alarm</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_alarm" title="Permalink to this definition">¶</a></dt>
  72. <dd><p>This event is called when the alarm is triggered.</p>
  73. </dd></dl>
  74. <dl class="attribute">
  75. <dt id="alarmdecoder.decoder.AlarmDecoder.on_fire">
  76. <tt class="descname">on_fire</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_fire" title="Permalink to this definition">¶</a></dt>
  77. <dd><p>This event is called when a fire is detected.</p>
  78. </dd></dl>
  79. <dl class="attribute">
  80. <dt id="alarmdecoder.decoder.AlarmDecoder.on_bypass">
  81. <tt class="descname">on_bypass</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_bypass" title="Permalink to this definition">¶</a></dt>
  82. <dd><p>This event is called when a zone is bypassed.</p>
  83. </dd></dl>
  84. <dl class="attribute">
  85. <dt id="alarmdecoder.decoder.AlarmDecoder.on_boot">
  86. <tt class="descname">on_boot</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_boot" title="Permalink to this definition">¶</a></dt>
  87. <dd><p>This event is called when the device finishes booting.</p>
  88. </dd></dl>
  89. <dl class="attribute">
  90. <dt id="alarmdecoder.decoder.AlarmDecoder.on_config_received">
  91. <tt class="descname">on_config_received</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_config_received" title="Permalink to this definition">¶</a></dt>
  92. <dd><p>This event is called when the device receives its configuration.</p>
  93. </dd></dl>
  94. <dl class="attribute">
  95. <dt id="alarmdecoder.decoder.AlarmDecoder.on_zone_fault">
  96. <tt class="descname">on_zone_fault</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_zone_fault" title="Permalink to this definition">¶</a></dt>
  97. <dd><p>This event is called when <a class="reference internal" href="#alarmdecoder.zonetracking.Zonetracker" title="alarmdecoder.zonetracking.Zonetracker"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.zonetracking.Zonetracker</span></tt></a> detects a zone fault.</p>
  98. </dd></dl>
  99. <dl class="attribute">
  100. <dt id="alarmdecoder.decoder.AlarmDecoder.on_zone_restore">
  101. <tt class="descname">on_zone_restore</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_zone_restore" title="Permalink to this definition">¶</a></dt>
  102. <dd><p>This event is called when <a class="reference internal" href="#alarmdecoder.zonetracking.Zonetracker" title="alarmdecoder.zonetracking.Zonetracker"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.zonetracking.Zonetracker</span></tt></a> detects that a fault is restored.</p>
  103. </dd></dl>
  104. <dl class="attribute">
  105. <dt id="alarmdecoder.decoder.AlarmDecoder.on_low_battery">
  106. <tt class="descname">on_low_battery</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_low_battery" title="Permalink to this definition">¶</a></dt>
  107. <dd><p>This event is called when the device detects a low battery.</p>
  108. </dd></dl>
  109. <dl class="attribute">
  110. <dt id="alarmdecoder.decoder.AlarmDecoder.on_panic">
  111. <tt class="descname">on_panic</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_panic" title="Permalink to this definition">¶</a></dt>
  112. <dd><p>This event is called when the device detects a panic.</p>
  113. </dd></dl>
  114. <dl class="attribute">
  115. <dt id="alarmdecoder.decoder.AlarmDecoder.on_relay_changed">
  116. <tt class="descname">on_relay_changed</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_relay_changed" title="Permalink to this definition">¶</a></dt>
  117. <dd><p>This event is called when a relay is opened or closed on an expander board.</p>
  118. </dd></dl>
  119. <dl class="attribute">
  120. <dt id="alarmdecoder.decoder.AlarmDecoder.on_message">
  121. <tt class="descname">on_message</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_message" title="Permalink to this definition">¶</a></dt>
  122. <dd><p>This event is called when any message is received.</p>
  123. </dd></dl>
  124. <dl class="attribute">
  125. <dt id="alarmdecoder.decoder.AlarmDecoder.on_lrr_message">
  126. <tt class="descname">on_lrr_message</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_lrr_message" title="Permalink to this definition">¶</a></dt>
  127. <dd><p>This event is called when an <a class="reference internal" href="#alarmdecoder.messages.LRRMessage" title="alarmdecoder.messages.LRRMessage"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.messages.LRRMessage</span></tt></a> is received.</p>
  128. </dd></dl>
  129. <dl class="attribute">
  130. <dt id="alarmdecoder.decoder.AlarmDecoder.on_rfx_message">
  131. <tt class="descname">on_rfx_message</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_rfx_message" title="Permalink to this definition">¶</a></dt>
  132. <dd><p>This event is called when an <a class="reference internal" href="#alarmdecoder.messages.RFMessage" title="alarmdecoder.messages.RFMessage"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.messages.RFMessage</span></tt></a> is received.</p>
  133. </dd></dl>
  134. <dl class="attribute">
  135. <dt id="alarmdecoder.decoder.AlarmDecoder.on_open">
  136. <tt class="descname">on_open</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_open" title="Permalink to this definition">¶</a></dt>
  137. <dd><p>This event is called when the device has been opened.</p>
  138. </dd></dl>
  139. <dl class="attribute">
  140. <dt id="alarmdecoder.decoder.AlarmDecoder.on_close">
  141. <tt class="descname">on_close</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_close" title="Permalink to this definition">¶</a></dt>
  142. <dd><p>This event is called when the device has been closed.</p>
  143. </dd></dl>
  144. <dl class="attribute">
  145. <dt id="alarmdecoder.decoder.AlarmDecoder.on_read">
  146. <tt class="descname">on_read</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_read" title="Permalink to this definition">¶</a></dt>
  147. <dd><p>This event is called when a line has been read from the device.</p>
  148. </dd></dl>
  149. <dl class="attribute">
  150. <dt id="alarmdecoder.decoder.AlarmDecoder.on_write">
  151. <tt class="descname">on_write</tt><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.on_write" title="Permalink to this definition">¶</a></dt>
  152. <dd><p>This event is called when data has been written to the device.</p>
  153. </dd></dl>
  154. <dl class="attribute">
  155. <dt id="alarmdecoder.decoder.AlarmDecoder.KEY_F1">
  156. <tt class="descname">KEY_F1</tt><em class="property"> = u'\x01\x01\x01'</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.KEY_F1" title="Permalink to this definition">¶</a></dt>
  157. <dd><p>Represents panel function key #1</p>
  158. </dd></dl>
  159. <dl class="attribute">
  160. <dt id="alarmdecoder.decoder.AlarmDecoder.KEY_F2">
  161. <tt class="descname">KEY_F2</tt><em class="property"> = u'\x02\x02\x02'</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.KEY_F2" title="Permalink to this definition">¶</a></dt>
  162. <dd><p>Represents panel function key #2</p>
  163. </dd></dl>
  164. <dl class="attribute">
  165. <dt id="alarmdecoder.decoder.AlarmDecoder.KEY_F3">
  166. <tt class="descname">KEY_F3</tt><em class="property"> = u'\x03\x03\x03'</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.KEY_F3" title="Permalink to this definition">¶</a></dt>
  167. <dd><p>Represents panel function key #3</p>
  168. </dd></dl>
  169. <dl class="attribute">
  170. <dt id="alarmdecoder.decoder.AlarmDecoder.KEY_F4">
  171. <tt class="descname">KEY_F4</tt><em class="property"> = u'\x04\x04\x04'</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.KEY_F4" title="Permalink to this definition">¶</a></dt>
  172. <dd><p>Represents panel function key #4</p>
  173. </dd></dl>
  174. <dl class="attribute">
  175. <dt id="alarmdecoder.decoder.AlarmDecoder.BATTERY_TIMEOUT">
  176. <tt class="descname">BATTERY_TIMEOUT</tt><em class="property"> = 30</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.BATTERY_TIMEOUT" title="Permalink to this definition">¶</a></dt>
  177. <dd><p>Default timeout (in seconds) before the battery status reverts.</p>
  178. </dd></dl>
  179. <dl class="attribute">
  180. <dt id="alarmdecoder.decoder.AlarmDecoder.FIRE_TIMEOUT">
  181. <tt class="descname">FIRE_TIMEOUT</tt><em class="property"> = 30</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.FIRE_TIMEOUT" title="Permalink to this definition">¶</a></dt>
  182. <dd><p>Default tTimeout (in seconds) before the fire status reverts.</p>
  183. </dd></dl>
  184. <dl class="attribute">
  185. <dt id="alarmdecoder.decoder.AlarmDecoder.address">
  186. <tt class="descname">address</tt><em class="property"> = 18</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.address" title="Permalink to this definition">¶</a></dt>
  187. <dd><p>The keypad address in use by the device.</p>
  188. </dd></dl>
  189. <dl class="attribute">
  190. <dt id="alarmdecoder.decoder.AlarmDecoder.configbits">
  191. <tt class="descname">configbits</tt><em class="property"> = 65280</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.configbits" title="Permalink to this definition">¶</a></dt>
  192. <dd><p>The configuration bits set on the device.</p>
  193. </dd></dl>
  194. <dl class="attribute">
  195. <dt id="alarmdecoder.decoder.AlarmDecoder.address_mask">
  196. <tt class="descname">address_mask</tt><em class="property"> = 0</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.address_mask" title="Permalink to this definition">¶</a></dt>
  197. <dd><p>The address mask configured on the device.</p>
  198. </dd></dl>
  199. <dl class="attribute">
  200. <dt id="alarmdecoder.decoder.AlarmDecoder.emulate_zone">
  201. <tt class="descname">emulate_zone</tt><em class="property"> = [False, False, False, False, False]</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.emulate_zone" title="Permalink to this definition">¶</a></dt>
  202. <dd><p>List containing the devices zone emulation status.</p>
  203. </dd></dl>
  204. <dl class="attribute">
  205. <dt id="alarmdecoder.decoder.AlarmDecoder.emulate_relay">
  206. <tt class="descname">emulate_relay</tt><em class="property"> = [False, False, False, False]</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.emulate_relay" title="Permalink to this definition">¶</a></dt>
  207. <dd><p>List containing the devices relay emulation status.</p>
  208. </dd></dl>
  209. <dl class="attribute">
  210. <dt id="alarmdecoder.decoder.AlarmDecoder.emulate_lrr">
  211. <tt class="descname">emulate_lrr</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.emulate_lrr" title="Permalink to this definition">¶</a></dt>
  212. <dd><p>The status of the devices LRR emulation.</p>
  213. </dd></dl>
  214. <dl class="attribute">
  215. <dt id="alarmdecoder.decoder.AlarmDecoder.deduplicate">
  216. <tt class="descname">deduplicate</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.deduplicate" title="Permalink to this definition">¶</a></dt>
  217. <dd><p>The status of message deduplication as configured on the device.</p>
  218. </dd></dl>
  219. <dl class="attribute">
  220. <dt id="alarmdecoder.decoder.AlarmDecoder.id">
  221. <tt class="descname">id</tt><a class="reference internal" href="_modules/alarmdecoder/decoder.html#AlarmDecoder.id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.id" title="Permalink to this definition">¶</a></dt>
  222. <dd><p>The ID of the <a class="reference external" href="http://www.alarmdecoder.com">Alarm Decoder</a> device.</p>
  223. <table class="docutils field-list" frame="void" rules="none">
  224. <col class="field-name" />
  225. <col class="field-body" />
  226. <tbody valign="top">
  227. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">identification string for the device</td>
  228. </tr>
  229. </tbody>
  230. </table>
  231. </dd></dl>
  232. <dl class="attribute">
  233. <dt id="alarmdecoder.decoder.AlarmDecoder.battery_timeout">
  234. <tt class="descname">battery_timeout</tt><a class="reference internal" href="_modules/alarmdecoder/decoder.html#AlarmDecoder.battery_timeout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.battery_timeout" title="Permalink to this definition">¶</a></dt>
  235. <dd><p>Retrieves the timeout for restoring the battery status, in seconds.</p>
  236. <table class="docutils field-list" frame="void" rules="none">
  237. <col class="field-name" />
  238. <col class="field-body" />
  239. <tbody valign="top">
  240. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">battery status timeout</td>
  241. </tr>
  242. </tbody>
  243. </table>
  244. </dd></dl>
  245. <dl class="attribute">
  246. <dt id="alarmdecoder.decoder.AlarmDecoder.fire_timeout">
  247. <tt class="descname">fire_timeout</tt><a class="reference internal" href="_modules/alarmdecoder/decoder.html#AlarmDecoder.fire_timeout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.fire_timeout" title="Permalink to this definition">¶</a></dt>
  248. <dd><p>Retrieves the timeout for restoring the fire status, in seconds.</p>
  249. <table class="docutils field-list" frame="void" rules="none">
  250. <col class="field-name" />
  251. <col class="field-body" />
  252. <tbody valign="top">
  253. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">fire status timeout</td>
  254. </tr>
  255. </tbody>
  256. </table>
  257. </dd></dl>
  258. <dl class="method">
  259. <dt id="alarmdecoder.decoder.AlarmDecoder.open">
  260. <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/alarmdecoder/decoder.html#AlarmDecoder.open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.open" title="Permalink to this definition">¶</a></dt>
  261. <dd><p>Opens the device.</p>
  262. <table class="docutils field-list" frame="void" rules="none">
  263. <col class="field-name" />
  264. <col class="field-body" />
  265. <tbody valign="top">
  266. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  267. <li><strong>baudrate</strong> (<em>int</em>) &#8211; baudrate used for the device. Defaults to the lower-level device default.</li>
  268. <li><strong>no_reader_thread</strong> (<em>bool</em>) &#8211; Specifies whether or not the automatic reader
  269. thread should be started.</li>
  270. </ul>
  271. </td>
  272. </tr>
  273. </tbody>
  274. </table>
  275. </dd></dl>
  276. <dl class="method">
  277. <dt id="alarmdecoder.decoder.AlarmDecoder.close">
  278. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/decoder.html#AlarmDecoder.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.close" title="Permalink to this definition">¶</a></dt>
  279. <dd><p>Closes the device.</p>
  280. </dd></dl>
  281. <dl class="method">
  282. <dt id="alarmdecoder.decoder.AlarmDecoder.send">
  283. <tt class="descname">send</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/decoder.html#AlarmDecoder.send"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.send" title="Permalink to this definition">¶</a></dt>
  284. <dd><p>Sends data to the <a class="reference external" href="http://www.alarmdecoder.com">Alarm Decoder</a> device.</p>
  285. <table class="docutils field-list" frame="void" rules="none">
  286. <col class="field-name" />
  287. <col class="field-body" />
  288. <tbody valign="top">
  289. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>string</em>) &#8211; data to send</td>
  290. </tr>
  291. </tbody>
  292. </table>
  293. </dd></dl>
  294. <dl class="method">
  295. <dt id="alarmdecoder.decoder.AlarmDecoder.get_config">
  296. <tt class="descname">get_config</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/decoder.html#AlarmDecoder.get_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.get_config" title="Permalink to this definition">¶</a></dt>
  297. <dd><p>Retrieves the configuration from the device. Called automatically by <tt class="xref py py-meth docutils literal"><span class="pre">_on_open()</span></tt>.</p>
  298. </dd></dl>
  299. <dl class="method">
  300. <dt id="alarmdecoder.decoder.AlarmDecoder.save_config">
  301. <tt class="descname">save_config</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/decoder.html#AlarmDecoder.save_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.save_config" title="Permalink to this definition">¶</a></dt>
  302. <dd><p>Sets configuration entries on the device.</p>
  303. </dd></dl>
  304. <dl class="method">
  305. <dt id="alarmdecoder.decoder.AlarmDecoder.reboot">
  306. <tt class="descname">reboot</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/decoder.html#AlarmDecoder.reboot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.reboot" title="Permalink to this definition">¶</a></dt>
  307. <dd><p>Reboots the device.</p>
  308. </dd></dl>
  309. <dl class="method">
  310. <dt id="alarmdecoder.decoder.AlarmDecoder.fault_zone">
  311. <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/alarmdecoder/decoder.html#AlarmDecoder.fault_zone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.fault_zone" title="Permalink to this definition">¶</a></dt>
  312. <dd><p>Faults a zone if we are emulating a zone expander.</p>
  313. <table class="docutils field-list" frame="void" rules="none">
  314. <col class="field-name" />
  315. <col class="field-body" />
  316. <tbody valign="top">
  317. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  318. <li><strong>zone</strong> (<em>int</em>) &#8211; zone to fault</li>
  319. <li><strong>simulate_wire_problem</strong> (<em>bool</em>) &#8211; Whether or not to simulate a wire fault</li>
  320. </ul>
  321. </td>
  322. </tr>
  323. </tbody>
  324. </table>
  325. </dd></dl>
  326. <dl class="method">
  327. <dt id="alarmdecoder.decoder.AlarmDecoder.clear_zone">
  328. <tt class="descname">clear_zone</tt><big>(</big><em>zone</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/decoder.html#AlarmDecoder.clear_zone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.decoder.AlarmDecoder.clear_zone" title="Permalink to this definition">¶</a></dt>
  329. <dd><p>Clears a zone if we are emulating a zone expander.</p>
  330. <table class="docutils field-list" frame="void" rules="none">
  331. <col class="field-name" />
  332. <col class="field-body" />
  333. <tbody valign="top">
  334. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>zone</strong> (<em>int</em>) &#8211; zone to clear</td>
  335. </tr>
  336. </tbody>
  337. </table>
  338. </dd></dl>
  339. </dd></dl>
  340. </div>
  341. <div class="section" id="module-alarmdecoder.devices">
  342. <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-alarmdecoder.devices" title="Permalink to this headline">¶</a></h2>
  343. <p>This module contains different types of devices belonging to the <a class="reference external" href="http://www.alarmdecoder.com">Alarm Decoder</a> (AD2) family.</p>
  344. <ul class="simple">
  345. <li><a class="reference internal" href="#alarmdecoder.devices.USBDevice" title="alarmdecoder.devices.USBDevice"><tt class="xref py py-class docutils literal"><span class="pre">USBDevice</span></tt></a>: Interfaces with the <a class="reference external" href="http://www.alarmdecoder.com">AD2USB</a> device.</li>
  346. <li><a class="reference internal" href="#alarmdecoder.devices.SerialDevice" title="alarmdecoder.devices.SerialDevice"><tt class="xref py py-class docutils literal"><span class="pre">SerialDevice</span></tt></a>: Interfaces with the <a class="reference external" href="http://www.alarmdecoder.com">AD2USB</a>, <a class="reference external" href="http://www.alarmdecoder.com">AD2SERIAL</a> or <a class="reference external" href="http://www.alarmdecoder.com">AD2PI</a>.</li>
  347. <li><a class="reference internal" href="#alarmdecoder.devices.SocketDevice" title="alarmdecoder.devices.SocketDevice"><tt class="xref py py-class docutils literal"><span class="pre">SocketDevice</span></tt></a>: Interfaces with devices exposed through <a class="reference external" href="http://github.com/nutechsoftware/ser2sock">ser2sock</a> or another IP to Serial solution.
  348. Also supports SSL if using <a class="reference external" href="http://github.com/nutechsoftware/ser2sock">ser2sock</a>.</li>
  349. </ul>
  350. <dl class="class">
  351. <dt id="alarmdecoder.devices.Device">
  352. <em class="property">class </em><tt class="descclassname">alarmdecoder.devices.</tt><tt class="descname">Device</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#Device"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.Device" title="Permalink to this definition">¶</a></dt>
  353. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  354. <p>Base class for all <a class="reference external" href="http://www.alarmdecoder.com">Alarm Decoder</a> (AD2) device types.</p>
  355. <dl class="attribute">
  356. <dt id="alarmdecoder.devices.Device.on_open">
  357. <tt class="descname">on_open</tt><a class="headerlink" href="#alarmdecoder.devices.Device.on_open" title="Permalink to this definition">¶</a></dt>
  358. <dd><p>This event is called when the device has been opened.</p>
  359. </dd></dl>
  360. <dl class="attribute">
  361. <dt id="alarmdecoder.devices.Device.on_close">
  362. <tt class="descname">on_close</tt><a class="headerlink" href="#alarmdecoder.devices.Device.on_close" title="Permalink to this definition">¶</a></dt>
  363. <dd><p>This event is called when the device has been closed.</p>
  364. </dd></dl>
  365. <dl class="attribute">
  366. <dt id="alarmdecoder.devices.Device.on_read">
  367. <tt class="descname">on_read</tt><a class="headerlink" href="#alarmdecoder.devices.Device.on_read" title="Permalink to this definition">¶</a></dt>
  368. <dd><p>This event is called when a line has been read from the device.</p>
  369. </dd></dl>
  370. <dl class="attribute">
  371. <dt id="alarmdecoder.devices.Device.on_write">
  372. <tt class="descname">on_write</tt><a class="headerlink" href="#alarmdecoder.devices.Device.on_write" title="Permalink to this definition">¶</a></dt>
  373. <dd><p>This event is called when data has been written to the device.</p>
  374. </dd></dl>
  375. <dl class="attribute">
  376. <dt id="alarmdecoder.devices.Device.id">
  377. <tt class="descname">id</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#Device.id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.Device.id" title="Permalink to this definition">¶</a></dt>
  378. <dd><p>Retrieve the device ID.</p>
  379. <table class="docutils field-list" frame="void" rules="none">
  380. <col class="field-name" />
  381. <col class="field-body" />
  382. <tbody valign="top">
  383. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">identification string for the device</td>
  384. </tr>
  385. </tbody>
  386. </table>
  387. </dd></dl>
  388. <dl class="method">
  389. <dt id="alarmdecoder.devices.Device.is_reader_alive">
  390. <tt class="descname">is_reader_alive</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#Device.is_reader_alive"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.Device.is_reader_alive" title="Permalink to this definition">¶</a></dt>
  391. <dd><p>Indicates whether or not the reader thread is alive.</p>
  392. <table class="docutils field-list" frame="void" rules="none">
  393. <col class="field-name" />
  394. <col class="field-body" />
  395. <tbody valign="top">
  396. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">whether or not the reader thread is alive</td>
  397. </tr>
  398. </tbody>
  399. </table>
  400. </dd></dl>
  401. <dl class="method">
  402. <dt id="alarmdecoder.devices.Device.stop_reader">
  403. <tt class="descname">stop_reader</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#Device.stop_reader"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.Device.stop_reader" title="Permalink to this definition">¶</a></dt>
  404. <dd><p>Stops the reader thread.</p>
  405. </dd></dl>
  406. <dl class="method">
  407. <dt id="alarmdecoder.devices.Device.close">
  408. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#Device.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.Device.close" title="Permalink to this definition">¶</a></dt>
  409. <dd><p>Closes the device.</p>
  410. </dd></dl>
  411. <dl class="class">
  412. <dt id="alarmdecoder.devices.Device.ReadThread">
  413. <em class="property">class </em><tt class="descname">ReadThread</tt><big>(</big><em>device</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#Device.ReadThread"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.Device.ReadThread" title="Permalink to this definition">¶</a></dt>
  414. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">threading.Thread</span></tt></p>
  415. <p>Reader thread which processes messages from the device.</p>
  416. <dl class="attribute">
  417. <dt id="alarmdecoder.devices.Device.ReadThread.READ_TIMEOUT">
  418. <tt class="descname">READ_TIMEOUT</tt><em class="property"> = 10</em><a class="headerlink" href="#alarmdecoder.devices.Device.ReadThread.READ_TIMEOUT" title="Permalink to this definition">¶</a></dt>
  419. <dd><p>Timeout for the reader thread.</p>
  420. </dd></dl>
  421. <dl class="method">
  422. <dt id="alarmdecoder.devices.Device.ReadThread.stop">
  423. <tt class="descname">stop</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#Device.ReadThread.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.Device.ReadThread.stop" title="Permalink to this definition">¶</a></dt>
  424. <dd><p>Stops the running thread.</p>
  425. </dd></dl>
  426. <dl class="method">
  427. <dt id="alarmdecoder.devices.Device.ReadThread.run">
  428. <tt class="descname">run</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#Device.ReadThread.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.Device.ReadThread.run" title="Permalink to this definition">¶</a></dt>
  429. <dd><p>The actual read process.</p>
  430. </dd></dl>
  431. </dd></dl>
  432. </dd></dl>
  433. <dl class="class">
  434. <dt id="alarmdecoder.devices.USBDevice">
  435. <em class="property">class </em><tt class="descclassname">alarmdecoder.devices.</tt><tt class="descname">USBDevice</tt><big>(</big><em>interface=0</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice" title="Permalink to this definition">¶</a></dt>
  436. <dd><p>Bases: <a class="reference internal" href="#alarmdecoder.devices.Device" title="alarmdecoder.devices.Device"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.devices.Device</span></tt></a></p>
  437. <p><a class="reference external" href="http://www.alarmdecoder.com">AD2USB</a> device utilizing PyFTDI&#8217;s interface.</p>
  438. <dl class="attribute">
  439. <dt id="alarmdecoder.devices.USBDevice.FTDI_VENDOR_ID">
  440. <tt class="descname">FTDI_VENDOR_ID</tt><em class="property"> = 1027</em><a class="headerlink" href="#alarmdecoder.devices.USBDevice.FTDI_VENDOR_ID" title="Permalink to this definition">¶</a></dt>
  441. <dd><p>Vendor ID used to recognize <a class="reference external" href="http://www.alarmdecoder.com">AD2USB</a> devices.</p>
  442. </dd></dl>
  443. <dl class="attribute">
  444. <dt id="alarmdecoder.devices.USBDevice.FTDI_PRODUCT_ID">
  445. <tt class="descname">FTDI_PRODUCT_ID</tt><em class="property"> = 24577</em><a class="headerlink" href="#alarmdecoder.devices.USBDevice.FTDI_PRODUCT_ID" title="Permalink to this definition">¶</a></dt>
  446. <dd><p>Product ID used to recognize <a class="reference external" href="http://www.alarmdecoder.com">AD2USB</a> devices.</p>
  447. </dd></dl>
  448. <dl class="attribute">
  449. <dt id="alarmdecoder.devices.USBDevice.BAUDRATE">
  450. <tt class="descname">BAUDRATE</tt><em class="property"> = 115200</em><a class="headerlink" href="#alarmdecoder.devices.USBDevice.BAUDRATE" title="Permalink to this definition">¶</a></dt>
  451. <dd><p>Default baudrate for <a class="reference external" href="http://www.alarmdecoder.com">AD2USB</a> devices.</p>
  452. </dd></dl>
  453. <dl class="classmethod">
  454. <dt id="alarmdecoder.devices.USBDevice.find_all">
  455. <em class="property">classmethod </em><tt class="descname">find_all</tt><big>(</big><em>vid=1027</em>, <em>pid=24577</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.find_all"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.find_all" title="Permalink to this definition">¶</a></dt>
  456. <dd><p>Returns all FTDI devices matching our vendor and product IDs.</p>
  457. <table class="docutils field-list" frame="void" rules="none">
  458. <col class="field-name" />
  459. <col class="field-body" />
  460. <tbody valign="top">
  461. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">list of devices</td>
  462. </tr>
  463. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a></td>
  464. </tr>
  465. </tbody>
  466. </table>
  467. </dd></dl>
  468. <dl class="classmethod">
  469. <dt id="alarmdecoder.devices.USBDevice.devices">
  470. <em class="property">classmethod </em><tt class="descname">devices</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.devices"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.devices" title="Permalink to this definition">¶</a></dt>
  471. <dd><p>Returns a cached list of <a class="reference external" href="http://www.alarmdecoder.com">AD2USB</a> devices located on the system.</p>
  472. <table class="docutils field-list" frame="void" rules="none">
  473. <col class="field-name" />
  474. <col class="field-body" />
  475. <tbody valign="top">
  476. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">cached list of devices found</td>
  477. </tr>
  478. </tbody>
  479. </table>
  480. </dd></dl>
  481. <dl class="classmethod">
  482. <dt id="alarmdecoder.devices.USBDevice.find">
  483. <em class="property">classmethod </em><tt class="descname">find</tt><big>(</big><em>device=None</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.find"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.find" title="Permalink to this definition">¶</a></dt>
  484. <dd><p>Factory method that returns the requested <a class="reference internal" href="#alarmdecoder.devices.USBDevice" title="alarmdecoder.devices.USBDevice"><tt class="xref py py-class docutils literal"><span class="pre">USBDevice</span></tt></a> device, or the
  485. first device.</p>
  486. <table class="docutils field-list" frame="void" rules="none">
  487. <col class="field-name" />
  488. <col class="field-body" />
  489. <tbody valign="top">
  490. <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
  491. by find_all().</td>
  492. </tr>
  493. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><a class="reference internal" href="#alarmdecoder.devices.USBDevice" title="alarmdecoder.devices.USBDevice"><tt class="xref py py-class docutils literal"><span class="pre">USBDevice</span></tt></a> object utilizing the specified device</td>
  494. </tr>
  495. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#alarmdecoder.util.NoDeviceError" title="alarmdecoder.util.NoDeviceError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.NoDeviceError</span></tt></a></td>
  496. </tr>
  497. </tbody>
  498. </table>
  499. </dd></dl>
  500. <dl class="classmethod">
  501. <dt id="alarmdecoder.devices.USBDevice.start_detection">
  502. <em class="property">classmethod </em><tt class="descname">start_detection</tt><big>(</big><em>on_attached=None</em>, <em>on_detached=None</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.start_detection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.start_detection" title="Permalink to this definition">¶</a></dt>
  503. <dd><p>Starts the device detection thread.</p>
  504. <table class="docutils field-list" frame="void" rules="none">
  505. <col class="field-name" />
  506. <col class="field-body" />
  507. <tbody valign="top">
  508. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  509. <li><strong>on_attached</strong> (<em>function</em>) &#8211; function to be called when a device is attached</li>
  510. <li><strong>on_detached</strong> (<em>function</em>) &#8211; function to be called when a device is detached</li>
  511. </ul>
  512. </td>
  513. </tr>
  514. </tbody>
  515. </table>
  516. </dd></dl>
  517. <dl class="classmethod">
  518. <dt id="alarmdecoder.devices.USBDevice.stop_detection">
  519. <em class="property">classmethod </em><tt class="descname">stop_detection</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.stop_detection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.stop_detection" title="Permalink to this definition">¶</a></dt>
  520. <dd><p>Stops the device detection thread.</p>
  521. </dd></dl>
  522. <dl class="attribute">
  523. <dt id="alarmdecoder.devices.USBDevice.serial_number">
  524. <tt class="descname">serial_number</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.serial_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.serial_number" title="Permalink to this definition">¶</a></dt>
  525. <dd><p>Retrieves the serial number of the device.</p>
  526. <table class="docutils field-list" frame="void" rules="none">
  527. <col class="field-name" />
  528. <col class="field-body" />
  529. <tbody valign="top">
  530. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">serial number of the device</td>
  531. </tr>
  532. </tbody>
  533. </table>
  534. </dd></dl>
  535. <dl class="attribute">
  536. <dt id="alarmdecoder.devices.USBDevice.description">
  537. <tt class="descname">description</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.description" title="Permalink to this definition">¶</a></dt>
  538. <dd><p>Retrieves the description of the device.</p>
  539. <table class="docutils field-list" frame="void" rules="none">
  540. <col class="field-name" />
  541. <col class="field-body" />
  542. <tbody valign="top">
  543. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">description of the device</td>
  544. </tr>
  545. </tbody>
  546. </table>
  547. </dd></dl>
  548. <dl class="attribute">
  549. <dt id="alarmdecoder.devices.USBDevice.interface">
  550. <tt class="descname">interface</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.interface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.interface" title="Permalink to this definition">¶</a></dt>
  551. <dd><p>Retrieves the interface used to connect to the device.</p>
  552. <table class="docutils field-list" frame="void" rules="none">
  553. <col class="field-name" />
  554. <col class="field-body" />
  555. <tbody valign="top">
  556. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">the interface used to connect to the device</td>
  557. </tr>
  558. </tbody>
  559. </table>
  560. </dd></dl>
  561. <dl class="method">
  562. <dt id="alarmdecoder.devices.USBDevice.open">
  563. <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/alarmdecoder/devices.html#USBDevice.open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.open" title="Permalink to this definition">¶</a></dt>
  564. <dd><p>Opens the device.</p>
  565. <table class="docutils field-list" frame="void" rules="none">
  566. <col class="field-name" />
  567. <col class="field-body" />
  568. <tbody valign="top">
  569. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  570. <li><strong>baudrate</strong> (<em>int</em>) &#8211; baudrate to use</li>
  571. <li><strong>no_reader_thread</strong> (<em>bool</em>) &#8211; whether or not to automatically start the
  572. reader thread.</li>
  573. </ul>
  574. </td>
  575. </tr>
  576. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last"><a class="reference internal" href="#alarmdecoder.util.NoDeviceError" title="alarmdecoder.util.NoDeviceError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.NoDeviceError</span></tt></a></p>
  577. </td>
  578. </tr>
  579. </tbody>
  580. </table>
  581. </dd></dl>
  582. <dl class="method">
  583. <dt id="alarmdecoder.devices.USBDevice.close">
  584. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.close" title="Permalink to this definition">¶</a></dt>
  585. <dd><p>Closes the device.</p>
  586. </dd></dl>
  587. <dl class="method">
  588. <dt id="alarmdecoder.devices.USBDevice.write">
  589. <tt class="descname">write</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.write" title="Permalink to this definition">¶</a></dt>
  590. <dd><p>Writes data to the device.</p>
  591. <table class="docutils field-list" frame="void" rules="none">
  592. <col class="field-name" />
  593. <col class="field-body" />
  594. <tbody valign="top">
  595. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>string</em>) &#8211; data to write</td>
  596. </tr>
  597. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a></td>
  598. </tr>
  599. </tbody>
  600. </table>
  601. </dd></dl>
  602. <dl class="method">
  603. <dt id="alarmdecoder.devices.USBDevice.read">
  604. <tt class="descname">read</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.read" title="Permalink to this definition">¶</a></dt>
  605. <dd><p>Reads a single character from the device.</p>
  606. <table class="docutils field-list" frame="void" rules="none">
  607. <col class="field-name" />
  608. <col class="field-body" />
  609. <tbody valign="top">
  610. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">character read from the device</td>
  611. </tr>
  612. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a></td>
  613. </tr>
  614. </tbody>
  615. </table>
  616. </dd></dl>
  617. <dl class="method">
  618. <dt id="alarmdecoder.devices.USBDevice.read_line">
  619. <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/alarmdecoder/devices.html#USBDevice.read_line"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.read_line" title="Permalink to this definition">¶</a></dt>
  620. <dd><p>Reads a line from the device.</p>
  621. <table class="docutils field-list" frame="void" rules="none">
  622. <col class="field-name" />
  623. <col class="field-body" />
  624. <tbody valign="top">
  625. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  626. <li><strong>timeout</strong> (<em>float</em>) &#8211; read timeout</li>
  627. <li><strong>purge_buffer</strong> (<em>bool</em>) &#8211; Indicates whether to purge the buffer prior to
  628. reading.</li>
  629. </ul>
  630. </td>
  631. </tr>
  632. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">line that was read</p>
  633. </td>
  634. </tr>
  635. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last"><a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a>, <a class="reference internal" href="#alarmdecoder.util.TimeoutError" title="alarmdecoder.util.TimeoutError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.TimeoutError</span></tt></a></p>
  636. </td>
  637. </tr>
  638. </tbody>
  639. </table>
  640. </dd></dl>
  641. <dl class="class">
  642. <dt id="alarmdecoder.devices.USBDevice.DetectThread">
  643. <em class="property">class </em><tt class="descname">DetectThread</tt><big>(</big><em>on_attached=None</em>, <em>on_detached=None</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.DetectThread"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.DetectThread" title="Permalink to this definition">¶</a></dt>
  644. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">threading.Thread</span></tt></p>
  645. <p>Thread that handles detection of added/removed devices.</p>
  646. <dl class="attribute">
  647. <dt id="alarmdecoder.devices.USBDevice.DetectThread.on_attached">
  648. <tt class="descname">on_attached</tt><a class="headerlink" href="#alarmdecoder.devices.USBDevice.DetectThread.on_attached" title="Permalink to this definition">¶</a></dt>
  649. <dd><p>This event is called when an <a class="reference external" href="http://www.alarmdecoder.com">AD2USB</a> device has been detected.</p>
  650. </dd></dl>
  651. <dl class="attribute">
  652. <dt id="alarmdecoder.devices.USBDevice.DetectThread.on_detached">
  653. <tt class="descname">on_detached</tt><a class="headerlink" href="#alarmdecoder.devices.USBDevice.DetectThread.on_detached" title="Permalink to this definition">¶</a></dt>
  654. <dd><p>This event is called when an <a class="reference external" href="http://www.alarmdecoder.com">AD2USB</a> device has been removed.</p>
  655. </dd></dl>
  656. <dl class="method">
  657. <dt id="alarmdecoder.devices.USBDevice.DetectThread.stop">
  658. <tt class="descname">stop</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.DetectThread.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.DetectThread.stop" title="Permalink to this definition">¶</a></dt>
  659. <dd><p>Stops the thread.</p>
  660. </dd></dl>
  661. <dl class="method">
  662. <dt id="alarmdecoder.devices.USBDevice.DetectThread.run">
  663. <tt class="descname">run</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#USBDevice.DetectThread.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.USBDevice.DetectThread.run" title="Permalink to this definition">¶</a></dt>
  664. <dd><p>The actual detection process.</p>
  665. </dd></dl>
  666. </dd></dl>
  667. </dd></dl>
  668. <dl class="class">
  669. <dt id="alarmdecoder.devices.SerialDevice">
  670. <em class="property">class </em><tt class="descclassname">alarmdecoder.devices.</tt><tt class="descname">SerialDevice</tt><big>(</big><em>interface=None</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#SerialDevice"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SerialDevice" title="Permalink to this definition">¶</a></dt>
  671. <dd><p>Bases: <a class="reference internal" href="#alarmdecoder.devices.Device" title="alarmdecoder.devices.Device"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.devices.Device</span></tt></a></p>
  672. <p><a class="reference external" href="http://www.alarmdecoder.com">AD2USB</a>, <a class="reference external" href="http://www.alarmdecoder.com">AD2SERIAL</a> or <a class="reference external" href="http://www.alarmdecoder.com">AD2PI</a> device utilizing the PySerial interface.</p>
  673. <dl class="attribute">
  674. <dt id="alarmdecoder.devices.SerialDevice.BAUDRATE">
  675. <tt class="descname">BAUDRATE</tt><em class="property"> = 19200</em><a class="headerlink" href="#alarmdecoder.devices.SerialDevice.BAUDRATE" title="Permalink to this definition">¶</a></dt>
  676. <dd><p>Default baudrate for Serial devices.</p>
  677. </dd></dl>
  678. <dl class="staticmethod">
  679. <dt id="alarmdecoder.devices.SerialDevice.find_all">
  680. <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/alarmdecoder/devices.html#SerialDevice.find_all"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SerialDevice.find_all" title="Permalink to this definition">¶</a></dt>
  681. <dd><p>Returns all serial ports present.</p>
  682. <table class="docutils field-list" frame="void" rules="none">
  683. <col class="field-name" />
  684. <col class="field-body" />
  685. <tbody valign="top">
  686. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>pattern</strong> (<em>string</em>) &#8211; pattern to search for when retrieving serial ports</td>
  687. </tr>
  688. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of devices</td>
  689. </tr>
  690. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a></td>
  691. </tr>
  692. </tbody>
  693. </table>
  694. </dd></dl>
  695. <dl class="attribute">
  696. <dt id="alarmdecoder.devices.SerialDevice.interface">
  697. <tt class="descname">interface</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#SerialDevice.interface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SerialDevice.interface" title="Permalink to this definition">¶</a></dt>
  698. <dd><p>Retrieves the interface used to connect to the device.</p>
  699. <table class="docutils field-list" frame="void" rules="none">
  700. <col class="field-name" />
  701. <col class="field-body" />
  702. <tbody valign="top">
  703. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">interface used to connect to the device</td>
  704. </tr>
  705. </tbody>
  706. </table>
  707. </dd></dl>
  708. <dl class="method">
  709. <dt id="alarmdecoder.devices.SerialDevice.open">
  710. <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/alarmdecoder/devices.html#SerialDevice.open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SerialDevice.open" title="Permalink to this definition">¶</a></dt>
  711. <dd><p>Opens the device.</p>
  712. <table class="docutils field-list" frame="void" rules="none">
  713. <col class="field-name" />
  714. <col class="field-body" />
  715. <tbody valign="top">
  716. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  717. <li><strong>baudrate</strong> (<em>int</em>) &#8211; baudrate to use with the device</li>
  718. <li><strong>no_reader_thread</strong> (<em>bool</em>) &#8211; whether or not to automatically start the
  719. reader thread.</li>
  720. </ul>
  721. </td>
  722. </tr>
  723. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last"><a class="reference internal" href="#alarmdecoder.util.NoDeviceError" title="alarmdecoder.util.NoDeviceError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.NoDeviceError</span></tt></a></p>
  724. </td>
  725. </tr>
  726. </tbody>
  727. </table>
  728. </dd></dl>
  729. <dl class="method">
  730. <dt id="alarmdecoder.devices.SerialDevice.close">
  731. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#SerialDevice.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SerialDevice.close" title="Permalink to this definition">¶</a></dt>
  732. <dd><p>Closes the device.</p>
  733. </dd></dl>
  734. <dl class="method">
  735. <dt id="alarmdecoder.devices.SerialDevice.write">
  736. <tt class="descname">write</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#SerialDevice.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SerialDevice.write" title="Permalink to this definition">¶</a></dt>
  737. <dd><p>Writes data to the device.</p>
  738. <table class="docutils field-list" frame="void" rules="none">
  739. <col class="field-name" />
  740. <col class="field-body" />
  741. <tbody valign="top">
  742. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>string</em>) &#8211; data to write</td>
  743. </tr>
  744. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body">py:class:<cite>alarmdecoder.util.CommError</cite></td>
  745. </tr>
  746. </tbody>
  747. </table>
  748. </dd></dl>
  749. <dl class="method">
  750. <dt id="alarmdecoder.devices.SerialDevice.read">
  751. <tt class="descname">read</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#SerialDevice.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SerialDevice.read" title="Permalink to this definition">¶</a></dt>
  752. <dd><p>Reads a single character from the device.</p>
  753. <table class="docutils field-list" frame="void" rules="none">
  754. <col class="field-name" />
  755. <col class="field-body" />
  756. <tbody valign="top">
  757. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">character read from the device</td>
  758. </tr>
  759. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a></td>
  760. </tr>
  761. </tbody>
  762. </table>
  763. </dd></dl>
  764. <dl class="method">
  765. <dt id="alarmdecoder.devices.SerialDevice.read_line">
  766. <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/alarmdecoder/devices.html#SerialDevice.read_line"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SerialDevice.read_line" title="Permalink to this definition">¶</a></dt>
  767. <dd><p>Reads a line from the device.</p>
  768. <table class="docutils field-list" frame="void" rules="none">
  769. <col class="field-name" />
  770. <col class="field-body" />
  771. <tbody valign="top">
  772. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  773. <li><strong>timeout</strong> (<em>float</em>) &#8211; read timeout</li>
  774. <li><strong>purge_buffer</strong> (<em>bool</em>) &#8211; Indicates whether to purge the buffer prior to
  775. reading.</li>
  776. </ul>
  777. </td>
  778. </tr>
  779. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">line that was read</p>
  780. </td>
  781. </tr>
  782. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last"><a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a>, <a class="reference internal" href="#alarmdecoder.util.TimeoutError" title="alarmdecoder.util.TimeoutError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.TimeoutError</span></tt></a></p>
  783. </td>
  784. </tr>
  785. </tbody>
  786. </table>
  787. </dd></dl>
  788. </dd></dl>
  789. <dl class="class">
  790. <dt id="alarmdecoder.devices.SocketDevice">
  791. <em class="property">class </em><tt class="descclassname">alarmdecoder.devices.</tt><tt class="descname">SocketDevice</tt><big>(</big><em>interface=('localhost'</em>, <em>10000)</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#SocketDevice"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice" title="Permalink to this definition">¶</a></dt>
  792. <dd><p>Bases: <a class="reference internal" href="#alarmdecoder.devices.Device" title="alarmdecoder.devices.Device"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.devices.Device</span></tt></a></p>
  793. <p>Device that supports communication with an <a class="reference external" href="http://www.alarmdecoder.com">Alarm Decoder</a> (AD2) that is
  794. exposed via <a class="reference external" href="http://github.com/nutechsoftware/ser2sock">ser2sock</a> or another Serial to IP interface.</p>
  795. <dl class="attribute">
  796. <dt id="alarmdecoder.devices.SocketDevice.interface">
  797. <tt class="descname">interface</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#SocketDevice.interface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice.interface" title="Permalink to this definition">¶</a></dt>
  798. <dd><p>Retrieves the interface used to connect to the device.</p>
  799. <table class="docutils field-list" frame="void" rules="none">
  800. <col class="field-name" />
  801. <col class="field-body" />
  802. <tbody valign="top">
  803. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">interface used to connect to the device</td>
  804. </tr>
  805. </tbody>
  806. </table>
  807. </dd></dl>
  808. <dl class="attribute">
  809. <dt id="alarmdecoder.devices.SocketDevice.ssl">
  810. <tt class="descname">ssl</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#SocketDevice.ssl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice.ssl" title="Permalink to this definition">¶</a></dt>
  811. <dd><p>Retrieves whether or not the device is using SSL.</p>
  812. <table class="docutils field-list" frame="void" rules="none">
  813. <col class="field-name" />
  814. <col class="field-body" />
  815. <tbody valign="top">
  816. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">whether or not the device is using SSL</td>
  817. </tr>
  818. </tbody>
  819. </table>
  820. </dd></dl>
  821. <dl class="attribute">
  822. <dt id="alarmdecoder.devices.SocketDevice.ssl_certificate">
  823. <tt class="descname">ssl_certificate</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#SocketDevice.ssl_certificate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice.ssl_certificate" title="Permalink to this definition">¶</a></dt>
  824. <dd><p>Retrieves the SSL client certificate path used for authentication.</p>
  825. <table class="docutils field-list" frame="void" rules="none">
  826. <col class="field-name" />
  827. <col class="field-body" />
  828. <tbody valign="top">
  829. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">path to the certificate path or <tt class="xref py py-class docutils literal"><span class="pre">OpenSSL.crypto.X509</span></tt></td>
  830. </tr>
  831. </tbody>
  832. </table>
  833. </dd></dl>
  834. <dl class="attribute">
  835. <dt id="alarmdecoder.devices.SocketDevice.ssl_key">
  836. <tt class="descname">ssl_key</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#SocketDevice.ssl_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice.ssl_key" title="Permalink to this definition">¶</a></dt>
  837. <dd><p>Retrieves the SSL client certificate key used for authentication.</p>
  838. <table class="docutils field-list" frame="void" rules="none">
  839. <col class="field-name" />
  840. <col class="field-body" />
  841. <tbody valign="top">
  842. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">jpath to the SSL key or <tt class="xref py py-class docutils literal"><span class="pre">OpenSSL.crypto.PKey</span></tt></td>
  843. </tr>
  844. </tbody>
  845. </table>
  846. </dd></dl>
  847. <dl class="attribute">
  848. <dt id="alarmdecoder.devices.SocketDevice.ssl_ca">
  849. <tt class="descname">ssl_ca</tt><a class="reference internal" href="_modules/alarmdecoder/devices.html#SocketDevice.ssl_ca"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice.ssl_ca" title="Permalink to this definition">¶</a></dt>
  850. <dd><p>Retrieves the SSL Certificate Authority certificate used for
  851. authentication.</p>
  852. <table class="docutils field-list" frame="void" rules="none">
  853. <col class="field-name" />
  854. <col class="field-body" />
  855. <tbody valign="top">
  856. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">path to the CA certificate or <tt class="xref py py-class docutils literal"><span class="pre">OpenSSL.crypto.X509</span></tt></td>
  857. </tr>
  858. </tbody>
  859. </table>
  860. </dd></dl>
  861. <dl class="method">
  862. <dt id="alarmdecoder.devices.SocketDevice.open">
  863. <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/alarmdecoder/devices.html#SocketDevice.open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice.open" title="Permalink to this definition">¶</a></dt>
  864. <dd><p>Opens the device.</p>
  865. <table class="docutils field-list" frame="void" rules="none">
  866. <col class="field-name" />
  867. <col class="field-body" />
  868. <tbody valign="top">
  869. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  870. <li><strong>baudrate</strong> (<em>int</em>) &#8211; baudrate to use</li>
  871. <li><strong>no_reader_thread</strong> (<em>bool</em>) &#8211; whether or not to automatically open the reader
  872. thread.</li>
  873. </ul>
  874. </td>
  875. </tr>
  876. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last"><a class="reference internal" href="#alarmdecoder.util.NoDeviceError" title="alarmdecoder.util.NoDeviceError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.NoDeviceError</span></tt></a>, <a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a></p>
  877. </td>
  878. </tr>
  879. </tbody>
  880. </table>
  881. </dd></dl>
  882. <dl class="method">
  883. <dt id="alarmdecoder.devices.SocketDevice.close">
  884. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#SocketDevice.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice.close" title="Permalink to this definition">¶</a></dt>
  885. <dd><p>Closes the device.</p>
  886. </dd></dl>
  887. <dl class="method">
  888. <dt id="alarmdecoder.devices.SocketDevice.write">
  889. <tt class="descname">write</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#SocketDevice.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice.write" title="Permalink to this definition">¶</a></dt>
  890. <dd><p>Writes data to the device.</p>
  891. <table class="docutils field-list" frame="void" rules="none">
  892. <col class="field-name" />
  893. <col class="field-body" />
  894. <tbody valign="top">
  895. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>string</em>) &#8211; data to write</td>
  896. </tr>
  897. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">number of bytes sent</td>
  898. </tr>
  899. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a></td>
  900. </tr>
  901. </tbody>
  902. </table>
  903. </dd></dl>
  904. <dl class="method">
  905. <dt id="alarmdecoder.devices.SocketDevice.read">
  906. <tt class="descname">read</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/alarmdecoder/devices.html#SocketDevice.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice.read" title="Permalink to this definition">¶</a></dt>
  907. <dd><p>Reads a single character from the device.</p>
  908. <table class="docutils field-list" frame="void" rules="none">
  909. <col class="field-name" />
  910. <col class="field-body" />
  911. <tbody valign="top">
  912. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">character read from the device</td>
  913. </tr>
  914. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a></td>
  915. </tr>
  916. </tbody>
  917. </table>
  918. </dd></dl>
  919. <dl class="method">
  920. <dt id="alarmdecoder.devices.SocketDevice.read_line">
  921. <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/alarmdecoder/devices.html#SocketDevice.read_line"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.devices.SocketDevice.read_line" title="Permalink to this definition">¶</a></dt>
  922. <dd><p>Reads a line from the device.</p>
  923. <table class="docutils field-list" frame="void" rules="none">
  924. <col class="field-name" />
  925. <col class="field-body" />
  926. <tbody valign="top">
  927. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  928. <li><strong>timeout</strong> (<em>float</em>) &#8211; read timeout</li>
  929. <li><strong>purge_buffer</strong> (<em>bool</em>) &#8211; Indicates whether to purge the buffer prior to
  930. reading.</li>
  931. </ul>
  932. </td>
  933. </tr>
  934. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">line that was read</p>
  935. </td>
  936. </tr>
  937. <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last"><a class="reference internal" href="#alarmdecoder.util.CommError" title="alarmdecoder.util.CommError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.CommError</span></tt></a>, <a class="reference internal" href="#alarmdecoder.util.TimeoutError" title="alarmdecoder.util.TimeoutError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.TimeoutError</span></tt></a></p>
  938. </td>
  939. </tr>
  940. </tbody>
  941. </table>
  942. </dd></dl>
  943. </dd></dl>
  944. </div>
  945. <div class="section" id="module-alarmdecoder.messages">
  946. <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-alarmdecoder.messages" title="Permalink to this headline">¶</a></h2>
  947. <p>Message representations received from the panel through the <a class="reference external" href="http://www.alarmdecoder.com">Alarm Decoder</a> (AD2)
  948. devices.</p>
  949. <ul class="simple">
  950. <li><a class="reference internal" href="#alarmdecoder.messages.Message" title="alarmdecoder.messages.Message"><tt class="xref py py-class docutils literal"><span class="pre">Message</span></tt></a>: The standard and most common message received from a panel.</li>
  951. <li><a class="reference internal" href="#alarmdecoder.messages.ExpanderMessage" title="alarmdecoder.messages.ExpanderMessage"><tt class="xref py py-class docutils literal"><span class="pre">ExpanderMessage</span></tt></a>: Messages received from Relay or Zone expander modules.</li>
  952. <li><a class="reference internal" href="#alarmdecoder.messages.RFMessage" title="alarmdecoder.messages.RFMessage"><tt class="xref py py-class docutils literal"><span class="pre">RFMessage</span></tt></a>: Message received from an RF receiver module.</li>
  953. <li><a class="reference internal" href="#alarmdecoder.messages.LRRMessage" title="alarmdecoder.messages.LRRMessage"><tt class="xref py py-class docutils literal"><span class="pre">LRRMessage</span></tt></a>: Message received from a long-range radio module.</li>
  954. </ul>
  955. <dl class="class">
  956. <dt id="alarmdecoder.messages.BaseMessage">
  957. <em class="property">class </em><tt class="descclassname">alarmdecoder.messages.</tt><tt class="descname">BaseMessage</tt><a class="reference internal" href="_modules/alarmdecoder/messages.html#BaseMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.messages.BaseMessage" title="Permalink to this definition">¶</a></dt>
  958. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  959. <p>Base class for messages.</p>
  960. <dl class="attribute">
  961. <dt id="alarmdecoder.messages.BaseMessage.raw">
  962. <tt class="descname">raw</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.messages.BaseMessage.raw" title="Permalink to this definition">¶</a></dt>
  963. <dd><p>The raw message text</p>
  964. </dd></dl>
  965. </dd></dl>
  966. <dl class="class">
  967. <dt id="alarmdecoder.messages.Message">
  968. <em class="property">class </em><tt class="descclassname">alarmdecoder.messages.</tt><tt class="descname">Message</tt><big>(</big><em>data=None</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/messages.html#Message"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.messages.Message" title="Permalink to this definition">¶</a></dt>
  969. <dd><p>Bases: <a class="reference internal" href="#alarmdecoder.messages.BaseMessage" title="alarmdecoder.messages.BaseMessage"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.messages.BaseMessage</span></tt></a></p>
  970. <p>Represents a message from the alarm panel.</p>
  971. <dl class="attribute">
  972. <dt id="alarmdecoder.messages.Message.ready">
  973. <tt class="descname">ready</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.ready" title="Permalink to this definition">¶</a></dt>
  974. <dd><p>Indicates whether or not the panel is in a ready state.</p>
  975. </dd></dl>
  976. <dl class="attribute">
  977. <dt id="alarmdecoder.messages.Message.armed_away">
  978. <tt class="descname">armed_away</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.armed_away" title="Permalink to this definition">¶</a></dt>
  979. <dd><p>Indicates whether or not the panel is armed away.</p>
  980. </dd></dl>
  981. <dl class="attribute">
  982. <dt id="alarmdecoder.messages.Message.armed_home">
  983. <tt class="descname">armed_home</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.armed_home" title="Permalink to this definition">¶</a></dt>
  984. <dd><p>Indicates whether or not the panel is armed home.</p>
  985. </dd></dl>
  986. <dl class="attribute">
  987. <dt id="alarmdecoder.messages.Message.backlight_on">
  988. <tt class="descname">backlight_on</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.backlight_on" title="Permalink to this definition">¶</a></dt>
  989. <dd><p>Indicates whether or not the keypad backlight is on.</p>
  990. </dd></dl>
  991. <dl class="attribute">
  992. <dt id="alarmdecoder.messages.Message.programming_mode">
  993. <tt class="descname">programming_mode</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.programming_mode" title="Permalink to this definition">¶</a></dt>
  994. <dd><p>Indicates whether or not we&#8217;re in programming mode.</p>
  995. </dd></dl>
  996. <dl class="attribute">
  997. <dt id="alarmdecoder.messages.Message.beeps">
  998. <tt class="descname">beeps</tt><em class="property"> = -1</em><a class="headerlink" href="#alarmdecoder.messages.Message.beeps" title="Permalink to this definition">¶</a></dt>
  999. <dd><p>Number of beeps associated with a message.</p>
  1000. </dd></dl>
  1001. <dl class="attribute">
  1002. <dt id="alarmdecoder.messages.Message.zone_bypassed">
  1003. <tt class="descname">zone_bypassed</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.zone_bypassed" title="Permalink to this definition">¶</a></dt>
  1004. <dd><p>Indicates whether or not a zone is bypassed.</p>
  1005. </dd></dl>
  1006. <dl class="attribute">
  1007. <dt id="alarmdecoder.messages.Message.ac_power">
  1008. <tt class="descname">ac_power</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.ac_power" title="Permalink to this definition">¶</a></dt>
  1009. <dd><p>Indicates whether or not the panel is on AC power.</p>
  1010. </dd></dl>
  1011. <dl class="attribute">
  1012. <dt id="alarmdecoder.messages.Message.chime_on">
  1013. <tt class="descname">chime_on</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.chime_on" title="Permalink to this definition">¶</a></dt>
  1014. <dd><p>Indicates whether or not the chime is enabled.</p>
  1015. </dd></dl>
  1016. <dl class="attribute">
  1017. <dt id="alarmdecoder.messages.Message.alarm_event_occurred">
  1018. <tt class="descname">alarm_event_occurred</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.alarm_event_occurred" title="Permalink to this definition">¶</a></dt>
  1019. <dd><p>Indicates whether or not an alarm event has occurred.</p>
  1020. </dd></dl>
  1021. <dl class="attribute">
  1022. <dt id="alarmdecoder.messages.Message.alarm_sounding">
  1023. <tt class="descname">alarm_sounding</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.alarm_sounding" title="Permalink to this definition">¶</a></dt>
  1024. <dd><p>Indicates whether or not an alarm is sounding.</p>
  1025. </dd></dl>
  1026. <dl class="attribute">
  1027. <dt id="alarmdecoder.messages.Message.battery_low">
  1028. <tt class="descname">battery_low</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.battery_low" title="Permalink to this definition">¶</a></dt>
  1029. <dd><p>Indicates whether or not there is a low battery.</p>
  1030. </dd></dl>
  1031. <dl class="attribute">
  1032. <dt id="alarmdecoder.messages.Message.entry_delay_off">
  1033. <tt class="descname">entry_delay_off</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.entry_delay_off" title="Permalink to this definition">¶</a></dt>
  1034. <dd><p>Indicates whether or not the entry delay is enabled.</p>
  1035. </dd></dl>
  1036. <dl class="attribute">
  1037. <dt id="alarmdecoder.messages.Message.fire_alarm">
  1038. <tt class="descname">fire_alarm</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.fire_alarm" title="Permalink to this definition">¶</a></dt>
  1039. <dd><p>Indicates whether or not a fire alarm is sounding.</p>
  1040. </dd></dl>
  1041. <dl class="attribute">
  1042. <dt id="alarmdecoder.messages.Message.check_zone">
  1043. <tt class="descname">check_zone</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.check_zone" title="Permalink to this definition">¶</a></dt>
  1044. <dd><p>Indicates whether or not there are zones that require attention.</p>
  1045. </dd></dl>
  1046. <dl class="attribute">
  1047. <dt id="alarmdecoder.messages.Message.perimeter_only">
  1048. <tt class="descname">perimeter_only</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.Message.perimeter_only" title="Permalink to this definition">¶</a></dt>
  1049. <dd><p>Indicates whether or not the perimeter is armed.</p>
  1050. </dd></dl>
  1051. <dl class="attribute">
  1052. <dt id="alarmdecoder.messages.Message.numeric_code">
  1053. <tt class="descname">numeric_code</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.messages.Message.numeric_code" title="Permalink to this definition">¶</a></dt>
  1054. <dd><p>The numeric code associated with the message.</p>
  1055. </dd></dl>
  1056. <dl class="attribute">
  1057. <dt id="alarmdecoder.messages.Message.text">
  1058. <tt class="descname">text</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.messages.Message.text" title="Permalink to this definition">¶</a></dt>
  1059. <dd><p>The human-readable text to be displayed on the panel LCD.</p>
  1060. </dd></dl>
  1061. <dl class="attribute">
  1062. <dt id="alarmdecoder.messages.Message.cursor_location">
  1063. <tt class="descname">cursor_location</tt><em class="property"> = -1</em><a class="headerlink" href="#alarmdecoder.messages.Message.cursor_location" title="Permalink to this definition">¶</a></dt>
  1064. <dd><p>Current cursor location on the keypad.</p>
  1065. </dd></dl>
  1066. <dl class="attribute">
  1067. <dt id="alarmdecoder.messages.Message.mask">
  1068. <tt class="descname">mask</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.messages.Message.mask" title="Permalink to this definition">¶</a></dt>
  1069. <dd><p>Address mask this message is intended for.</p>
  1070. </dd></dl>
  1071. <dl class="attribute">
  1072. <dt id="alarmdecoder.messages.Message.bitfield">
  1073. <tt class="descname">bitfield</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.messages.Message.bitfield" title="Permalink to this definition">¶</a></dt>
  1074. <dd><p>The bitfield associated with this message.</p>
  1075. </dd></dl>
  1076. <dl class="attribute">
  1077. <dt id="alarmdecoder.messages.Message.panel_data">
  1078. <tt class="descname">panel_data</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.messages.Message.panel_data" title="Permalink to this definition">¶</a></dt>
  1079. <dd><p>The panel data field associated with this message.</p>
  1080. </dd></dl>
  1081. </dd></dl>
  1082. <dl class="class">
  1083. <dt id="alarmdecoder.messages.ExpanderMessage">
  1084. <em class="property">class </em><tt class="descclassname">alarmdecoder.messages.</tt><tt class="descname">ExpanderMessage</tt><big>(</big><em>data=None</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/messages.html#ExpanderMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.messages.ExpanderMessage" title="Permalink to this definition">¶</a></dt>
  1085. <dd><p>Bases: <a class="reference internal" href="#alarmdecoder.messages.BaseMessage" title="alarmdecoder.messages.BaseMessage"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.messages.BaseMessage</span></tt></a></p>
  1086. <p>Represents a message from a zone or relay expansion module.</p>
  1087. <dl class="attribute">
  1088. <dt id="alarmdecoder.messages.ExpanderMessage.ZONE">
  1089. <tt class="descname">ZONE</tt><em class="property"> = 0</em><a class="headerlink" href="#alarmdecoder.messages.ExpanderMessage.ZONE" title="Permalink to this definition">¶</a></dt>
  1090. <dd><p>Flag indicating that the expander message relates to a Zone Expander.</p>
  1091. </dd></dl>
  1092. <dl class="attribute">
  1093. <dt id="alarmdecoder.messages.ExpanderMessage.RELAY">
  1094. <tt class="descname">RELAY</tt><em class="property"> = 1</em><a class="headerlink" href="#alarmdecoder.messages.ExpanderMessage.RELAY" title="Permalink to this definition">¶</a></dt>
  1095. <dd><p>Flag indicating that the expander message relates to a Relay Expander.</p>
  1096. </dd></dl>
  1097. <dl class="attribute">
  1098. <dt id="alarmdecoder.messages.ExpanderMessage.type">
  1099. <tt class="descname">type</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.messages.ExpanderMessage.type" title="Permalink to this definition">¶</a></dt>
  1100. <dd><p>Expander message type: ExpanderMessage.ZONE or ExpanderMessage.RELAY</p>
  1101. </dd></dl>
  1102. <dl class="attribute">
  1103. <dt id="alarmdecoder.messages.ExpanderMessage.address">
  1104. <tt class="descname">address</tt><em class="property"> = -1</em><a class="headerlink" href="#alarmdecoder.messages.ExpanderMessage.address" title="Permalink to this definition">¶</a></dt>
  1105. <dd><p>Address of expander</p>
  1106. </dd></dl>
  1107. <dl class="attribute">
  1108. <dt id="alarmdecoder.messages.ExpanderMessage.channel">
  1109. <tt class="descname">channel</tt><em class="property"> = -1</em><a class="headerlink" href="#alarmdecoder.messages.ExpanderMessage.channel" title="Permalink to this definition">¶</a></dt>
  1110. <dd><p>Channel on the expander</p>
  1111. </dd></dl>
  1112. <dl class="attribute">
  1113. <dt id="alarmdecoder.messages.ExpanderMessage.value">
  1114. <tt class="descname">value</tt><em class="property"> = -1</em><a class="headerlink" href="#alarmdecoder.messages.ExpanderMessage.value" title="Permalink to this definition">¶</a></dt>
  1115. <dd><p>Value associated with the message</p>
  1116. </dd></dl>
  1117. </dd></dl>
  1118. <dl class="class">
  1119. <dt id="alarmdecoder.messages.RFMessage">
  1120. <em class="property">class </em><tt class="descclassname">alarmdecoder.messages.</tt><tt class="descname">RFMessage</tt><big>(</big><em>data=None</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/messages.html#RFMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.messages.RFMessage" title="Permalink to this definition">¶</a></dt>
  1121. <dd><p>Bases: <a class="reference internal" href="#alarmdecoder.messages.BaseMessage" title="alarmdecoder.messages.BaseMessage"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.messages.BaseMessage</span></tt></a></p>
  1122. <p>Represents a message from an RF receiver.</p>
  1123. <dl class="attribute">
  1124. <dt id="alarmdecoder.messages.RFMessage.serial_number">
  1125. <tt class="descname">serial_number</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.messages.RFMessage.serial_number" title="Permalink to this definition">¶</a></dt>
  1126. <dd><p>Serial number of the RF device.</p>
  1127. </dd></dl>
  1128. <dl class="attribute">
  1129. <dt id="alarmdecoder.messages.RFMessage.value">
  1130. <tt class="descname">value</tt><em class="property"> = -1</em><a class="headerlink" href="#alarmdecoder.messages.RFMessage.value" title="Permalink to this definition">¶</a></dt>
  1131. <dd><p>Value associated with this message.</p>
  1132. </dd></dl>
  1133. <dl class="attribute">
  1134. <dt id="alarmdecoder.messages.RFMessage.battery">
  1135. <tt class="descname">battery</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.RFMessage.battery" title="Permalink to this definition">¶</a></dt>
  1136. <dd><p>Low battery indication</p>
  1137. </dd></dl>
  1138. <dl class="attribute">
  1139. <dt id="alarmdecoder.messages.RFMessage.supervision">
  1140. <tt class="descname">supervision</tt><em class="property"> = False</em><a class="headerlink" href="#alarmdecoder.messages.RFMessage.supervision" title="Permalink to this definition">¶</a></dt>
  1141. <dd><p>Supervision required indication</p>
  1142. </dd></dl>
  1143. <dl class="attribute">
  1144. <dt id="alarmdecoder.messages.RFMessage.loop">
  1145. <tt class="descname">loop</tt><em class="property"> = [False, False, False, False]</em><a class="headerlink" href="#alarmdecoder.messages.RFMessage.loop" title="Permalink to this definition">¶</a></dt>
  1146. <dd><p>Loop indicators</p>
  1147. </dd></dl>
  1148. </dd></dl>
  1149. <dl class="class">
  1150. <dt id="alarmdecoder.messages.LRRMessage">
  1151. <em class="property">class </em><tt class="descclassname">alarmdecoder.messages.</tt><tt class="descname">LRRMessage</tt><big>(</big><em>data=None</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/messages.html#LRRMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.messages.LRRMessage" title="Permalink to this definition">¶</a></dt>
  1152. <dd><p>Bases: <a class="reference internal" href="#alarmdecoder.messages.BaseMessage" title="alarmdecoder.messages.BaseMessage"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.messages.BaseMessage</span></tt></a></p>
  1153. <p>Represent a message from a Long Range Radio.</p>
  1154. <dl class="attribute">
  1155. <dt id="alarmdecoder.messages.LRRMessage.event_data">
  1156. <tt class="descname">event_data</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.messages.LRRMessage.event_data" title="Permalink to this definition">¶</a></dt>
  1157. <dd><p>Data associated with the LRR message. Usually user ID or zone.</p>
  1158. </dd></dl>
  1159. <dl class="attribute">
  1160. <dt id="alarmdecoder.messages.LRRMessage.partition">
  1161. <tt class="descname">partition</tt><em class="property"> = -1</em><a class="headerlink" href="#alarmdecoder.messages.LRRMessage.partition" title="Permalink to this definition">¶</a></dt>
  1162. <dd><p>The partition that this message applies to.</p>
  1163. </dd></dl>
  1164. <dl class="attribute">
  1165. <dt id="alarmdecoder.messages.LRRMessage.event_type">
  1166. <tt class="descname">event_type</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.messages.LRRMessage.event_type" title="Permalink to this definition">¶</a></dt>
  1167. <dd><p>The type of the event that occurred.</p>
  1168. </dd></dl>
  1169. </dd></dl>
  1170. </div>
  1171. <div class="section" id="module-alarmdecoder.zonetracking">
  1172. <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-alarmdecoder.zonetracking" title="Permalink to this headline">¶</a></h2>
  1173. <p>Provides zone tracking functionality for the <a class="reference external" href="http://www.alarmdecoder.com">Alarm Decoder</a> (AD2) device family.</p>
  1174. <dl class="class">
  1175. <dt id="alarmdecoder.zonetracking.Zone">
  1176. <em class="property">class </em><tt class="descclassname">alarmdecoder.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/alarmdecoder/zonetracking.html#Zone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.zonetracking.Zone" title="Permalink to this definition">¶</a></dt>
  1177. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  1178. <p>Representation of a panel zone.</p>
  1179. <dl class="attribute">
  1180. <dt id="alarmdecoder.zonetracking.Zone.CLEAR">
  1181. <tt class="descname">CLEAR</tt><em class="property"> = 0</em><a class="headerlink" href="#alarmdecoder.zonetracking.Zone.CLEAR" title="Permalink to this definition">¶</a></dt>
  1182. <dd><p>Status indicating that the zone is cleared.</p>
  1183. </dd></dl>
  1184. <dl class="attribute">
  1185. <dt id="alarmdecoder.zonetracking.Zone.FAULT">
  1186. <tt class="descname">FAULT</tt><em class="property"> = 1</em><a class="headerlink" href="#alarmdecoder.zonetracking.Zone.FAULT" title="Permalink to this definition">¶</a></dt>
  1187. <dd><p>Status indicating that the zone is faulted.</p>
  1188. </dd></dl>
  1189. <dl class="attribute">
  1190. <dt id="alarmdecoder.zonetracking.Zone.CHECK">
  1191. <tt class="descname">CHECK</tt><em class="property"> = 2</em><a class="headerlink" href="#alarmdecoder.zonetracking.Zone.CHECK" title="Permalink to this definition">¶</a></dt>
  1192. <dd><p>Status indicating that there is a wiring issue with the zone.</p>
  1193. </dd></dl>
  1194. <dl class="attribute">
  1195. <dt id="alarmdecoder.zonetracking.Zone.STATUS">
  1196. <tt class="descname">STATUS</tt><em class="property"> = {0: 'CLEAR', 1: 'FAULT', 2: 'CHECK'}</em><a class="headerlink" href="#alarmdecoder.zonetracking.Zone.STATUS" title="Permalink to this definition">¶</a></dt>
  1197. <dd></dd></dl>
  1198. <dl class="attribute">
  1199. <dt id="alarmdecoder.zonetracking.Zone.zone">
  1200. <tt class="descname">zone</tt><em class="property"> = 0</em><a class="headerlink" href="#alarmdecoder.zonetracking.Zone.zone" title="Permalink to this definition">¶</a></dt>
  1201. <dd><p>Zone ID</p>
  1202. </dd></dl>
  1203. <dl class="attribute">
  1204. <dt id="alarmdecoder.zonetracking.Zone.name">
  1205. <tt class="descname">name</tt><em class="property"> = ''</em><a class="headerlink" href="#alarmdecoder.zonetracking.Zone.name" title="Permalink to this definition">¶</a></dt>
  1206. <dd><p>Zone name</p>
  1207. </dd></dl>
  1208. <dl class="attribute">
  1209. <dt id="alarmdecoder.zonetracking.Zone.status">
  1210. <tt class="descname">status</tt><em class="property"> = 0</em><a class="headerlink" href="#alarmdecoder.zonetracking.Zone.status" title="Permalink to this definition">¶</a></dt>
  1211. <dd><p>Zone status</p>
  1212. </dd></dl>
  1213. <dl class="attribute">
  1214. <dt id="alarmdecoder.zonetracking.Zone.timestamp">
  1215. <tt class="descname">timestamp</tt><em class="property"> = None</em><a class="headerlink" href="#alarmdecoder.zonetracking.Zone.timestamp" title="Permalink to this definition">¶</a></dt>
  1216. <dd><p>Timestamp of last update</p>
  1217. </dd></dl>
  1218. </dd></dl>
  1219. <dl class="class">
  1220. <dt id="alarmdecoder.zonetracking.Zonetracker">
  1221. <em class="property">class </em><tt class="descclassname">alarmdecoder.zonetracking.</tt><tt class="descname">Zonetracker</tt><a class="reference internal" href="_modules/alarmdecoder/zonetracking.html#Zonetracker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.zonetracking.Zonetracker" title="Permalink to this definition">¶</a></dt>
  1222. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  1223. <p>Handles tracking of zones and their statuses.</p>
  1224. <dl class="attribute">
  1225. <dt id="alarmdecoder.zonetracking.Zonetracker.on_fault">
  1226. <tt class="descname">on_fault</tt><a class="headerlink" href="#alarmdecoder.zonetracking.Zonetracker.on_fault" title="Permalink to this definition">¶</a></dt>
  1227. <dd><p>This event is called when the device detects a zone fault.</p>
  1228. </dd></dl>
  1229. <dl class="attribute">
  1230. <dt id="alarmdecoder.zonetracking.Zonetracker.on_restore">
  1231. <tt class="descname">on_restore</tt><a class="headerlink" href="#alarmdecoder.zonetracking.Zonetracker.on_restore" title="Permalink to this definition">¶</a></dt>
  1232. <dd><p>This event is called when the device detects that a fault is restored.</p>
  1233. </dd></dl>
  1234. <dl class="attribute">
  1235. <dt id="alarmdecoder.zonetracking.Zonetracker.EXPIRE">
  1236. <tt class="descname">EXPIRE</tt><em class="property"> = 30</em><a class="headerlink" href="#alarmdecoder.zonetracking.Zonetracker.EXPIRE" title="Permalink to this definition">¶</a></dt>
  1237. <dd><p>Zone expiration timeout.</p>
  1238. </dd></dl>
  1239. <dl class="attribute">
  1240. <dt id="alarmdecoder.zonetracking.Zonetracker.zones">
  1241. <tt class="descname">zones</tt><a class="headerlink" href="#alarmdecoder.zonetracking.Zonetracker.zones" title="Permalink to this definition">¶</a></dt>
  1242. <dd><p>Returns the current list of zones being tracked.</p>
  1243. <table class="docutils field-list" frame="void" rules="none">
  1244. <col class="field-name" />
  1245. <col class="field-body" />
  1246. <tbody valign="top">
  1247. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">dictionary of <a class="reference internal" href="#alarmdecoder.zonetracking.Zone" title="alarmdecoder.zonetracking.Zone"><tt class="xref py py-class docutils literal"><span class="pre">Zone</span></tt></a> being tracked</td>
  1248. </tr>
  1249. </tbody>
  1250. </table>
  1251. </dd></dl>
  1252. <dl class="attribute">
  1253. <dt id="alarmdecoder.zonetracking.Zonetracker.faulted">
  1254. <tt class="descname">faulted</tt><a class="headerlink" href="#alarmdecoder.zonetracking.Zonetracker.faulted" title="Permalink to this definition">¶</a></dt>
  1255. <dd><p>Retrieves the current list of faulted zones.</p>
  1256. <table class="docutils field-list" frame="void" rules="none">
  1257. <col class="field-name" />
  1258. <col class="field-body" />
  1259. <tbody valign="top">
  1260. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">list of faulted zones</td>
  1261. </tr>
  1262. </tbody>
  1263. </table>
  1264. </dd></dl>
  1265. <dl class="method">
  1266. <dt id="alarmdecoder.zonetracking.Zonetracker.update">
  1267. <tt class="descname">update</tt><big>(</big><em>message</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/zonetracking.html#Zonetracker.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.zonetracking.Zonetracker.update" title="Permalink to this definition">¶</a></dt>
  1268. <dd><p>Update zone statuses based on the current message.</p>
  1269. <table class="docutils field-list" frame="void" rules="none">
  1270. <col class="field-name" />
  1271. <col class="field-body" />
  1272. <tbody valign="top">
  1273. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>message</strong> (<a class="reference internal" href="#alarmdecoder.messages.Message" title="alarmdecoder.messages.Message"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.messages.Message</span></tt></a> or <a class="reference internal" href="#alarmdecoder.messages.ExpanderMessage" title="alarmdecoder.messages.ExpanderMessage"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.messages.ExpanderMessage</span></tt></a>) &#8211; message to use to update the zone tracking</td>
  1274. </tr>
  1275. </tbody>
  1276. </table>
  1277. </dd></dl>
  1278. <dl class="method">
  1279. <dt id="alarmdecoder.zonetracking.Zonetracker.expander_to_zone">
  1280. <tt class="descname">expander_to_zone</tt><big>(</big><em>address</em>, <em>channel</em><big>)</big><a class="reference internal" href="_modules/alarmdecoder/zonetracking.html#Zonetracker.expander_to_zone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.zonetracking.Zonetracker.expander_to_zone" title="Permalink to this definition">¶</a></dt>
  1281. <dd><p>Convert an address and channel into a zone number.</p>
  1282. <table class="docutils field-list" frame="void" rules="none">
  1283. <col class="field-name" />
  1284. <col class="field-body" />
  1285. <tbody valign="top">
  1286. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1287. <li><strong>address</strong> (<em>int</em>) &#8211; expander address</li>
  1288. <li><strong>channel</strong> (<em>int</em>) &#8211; channel</li>
  1289. </ul>
  1290. </td>
  1291. </tr>
  1292. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">zone number associated with an address and channel</p>
  1293. </td>
  1294. </tr>
  1295. </tbody>
  1296. </table>
  1297. </dd></dl>
  1298. </dd></dl>
  1299. </div>
  1300. <div class="section" id="module-alarmdecoder.util">
  1301. <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-alarmdecoder.util" title="Permalink to this headline">¶</a></h2>
  1302. <p>Provides utility classes for the <a class="reference external" href="http://www.alarmdecoder.com">Alarm Decoder</a> (AD2) devices.</p>
  1303. <dl class="exception">
  1304. <dt id="alarmdecoder.util.NoDeviceError">
  1305. <em class="property">exception </em><tt class="descclassname">alarmdecoder.util.</tt><tt class="descname">NoDeviceError</tt><a class="reference internal" href="_modules/alarmdecoder/util.html#NoDeviceError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.util.NoDeviceError" title="Permalink to this definition">¶</a></dt>
  1306. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
  1307. <p>No devices found.</p>
  1308. </dd></dl>
  1309. <dl class="exception">
  1310. <dt id="alarmdecoder.util.CommError">
  1311. <em class="property">exception </em><tt class="descclassname">alarmdecoder.util.</tt><tt class="descname">CommError</tt><a class="reference internal" href="_modules/alarmdecoder/util.html#CommError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.util.CommError" title="Permalink to this definition">¶</a></dt>
  1312. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
  1313. <p>There was an error communicating with the device.</p>
  1314. </dd></dl>
  1315. <dl class="exception">
  1316. <dt id="alarmdecoder.util.TimeoutError">
  1317. <em class="property">exception </em><tt class="descclassname">alarmdecoder.util.</tt><tt class="descname">TimeoutError</tt><a class="reference internal" href="_modules/alarmdecoder/util.html#TimeoutError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.util.TimeoutError" title="Permalink to this definition">¶</a></dt>
  1318. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
  1319. <p>There was a timeout while trying to communicate with the device.</p>
  1320. </dd></dl>
  1321. <dl class="exception">
  1322. <dt id="alarmdecoder.util.InvalidMessageError">
  1323. <em class="property">exception </em><tt class="descclassname">alarmdecoder.util.</tt><tt class="descname">InvalidMessageError</tt><a class="reference internal" href="_modules/alarmdecoder/util.html#InvalidMessageError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.util.InvalidMessageError" title="Permalink to this definition">¶</a></dt>
  1324. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
  1325. <p>The format of the panel message was invalid.</p>
  1326. </dd></dl>
  1327. <dl class="class">
  1328. <dt id="alarmdecoder.util.Firmware">
  1329. <em class="property">class </em><tt class="descclassname">alarmdecoder.util.</tt><tt class="descname">Firmware</tt><a class="reference internal" href="_modules/alarmdecoder/util.html#Firmware"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.util.Firmware" title="Permalink to this definition">¶</a></dt>
  1330. <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
  1331. <p>Represents firmware for the Alarm Decoder devices.</p>
  1332. <dl class="attribute">
  1333. <dt id="alarmdecoder.util.Firmware.STAGE_START">
  1334. <tt class="descname">STAGE_START</tt><em class="property"> = 0</em><a class="headerlink" href="#alarmdecoder.util.Firmware.STAGE_START" title="Permalink to this definition">¶</a></dt>
  1335. <dd></dd></dl>
  1336. <dl class="attribute">
  1337. <dt id="alarmdecoder.util.Firmware.STAGE_WAITING">
  1338. <tt class="descname">STAGE_WAITING</tt><em class="property"> = 1</em><a class="headerlink" href="#alarmdecoder.util.Firmware.STAGE_WAITING" title="Permalink to this definition">¶</a></dt>
  1339. <dd></dd></dl>
  1340. <dl class="attribute">
  1341. <dt id="alarmdecoder.util.Firmware.STAGE_BOOT">
  1342. <tt class="descname">STAGE_BOOT</tt><em class="property"> = 2</em><a class="headerlink" href="#alarmdecoder.util.Firmware.STAGE_BOOT" title="Permalink to this definition">¶</a></dt>
  1343. <dd></dd></dl>
  1344. <dl class="attribute">
  1345. <dt id="alarmdecoder.util.Firmware.STAGE_LOAD">
  1346. <tt class="descname">STAGE_LOAD</tt><em class="property"> = 3</em><a class="headerlink" href="#alarmdecoder.util.Firmware.STAGE_LOAD" title="Permalink to this definition">¶</a></dt>
  1347. <dd></dd></dl>
  1348. <dl class="attribute">
  1349. <dt id="alarmdecoder.util.Firmware.STAGE_UPLOADING">
  1350. <tt class="descname">STAGE_UPLOADING</tt><em class="property"> = 4</em><a class="headerlink" href="#alarmdecoder.util.Firmware.STAGE_UPLOADING" title="Permalink to this definition">¶</a></dt>
  1351. <dd></dd></dl>
  1352. <dl class="attribute">
  1353. <dt id="alarmdecoder.util.Firmware.STAGE_DONE">
  1354. <tt class="descname">STAGE_DONE</tt><em class="property"> = 5</em><a class="headerlink" href="#alarmdecoder.util.Firmware.STAGE_DONE" title="Permalink to this definition">¶</a></dt>
  1355. <dd></dd></dl>
  1356. <dl class="staticmethod">
  1357. <dt id="alarmdecoder.util.Firmware.upload">
  1358. <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/alarmdecoder/util.html#Firmware.upload"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#alarmdecoder.util.Firmware.upload" title="Permalink to this definition">¶</a></dt>
  1359. <dd><p>Uploads firmware to an <a class="reference external" href="http://www.alarmdecoder.com">Alarm Decoder</a> device.</p>
  1360. <table class="docutils field-list" frame="void" rules="none">
  1361. <col class="field-name" />
  1362. <col class="field-body" />
  1363. <tbody valign="top">
  1364. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1365. <li><strong>filename</strong> (<em>string</em>) &#8211; firmware filename</li>
  1366. <li><strong>progress_callback</strong> (<em>function</em>) &#8211; callback function used to report progress</li>
  1367. </ul>
  1368. </td>
  1369. </tr>
  1370. <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last"><a class="reference internal" href="#alarmdecoder.util.NoDeviceError" title="alarmdecoder.util.NoDeviceError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.NoDeviceError</span></tt></a>, <a class="reference internal" href="#alarmdecoder.util.TimeoutError" title="alarmdecoder.util.TimeoutError"><tt class="xref py py-class docutils literal"><span class="pre">alarmdecoder.util.TimeoutError</span></tt></a></p>
  1371. </td>
  1372. </tr>
  1373. </tbody>
  1374. </table>
  1375. </dd></dl>
  1376. </dd></dl>
  1377. </div>
  1378. <div class="section" id="module-alarmdecoder.panels">
  1379. <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-alarmdecoder.panels" title="Permalink to this headline">¶</a></h2>
  1380. <p>Representations of Panels and their templates.</p>
  1381. </div>
  1382. </div>
  1383. </div>
  1384. </div>
  1385. </div>
  1386. <div class="sphinxsidebar">
  1387. <div class="sphinxsidebarwrapper">
  1388. <h3><a href="index.html">Table Of Contents</a></h3>
  1389. <ul>
  1390. <li><a class="reference internal" href="#">alarmdecoder Package</a><ul>
  1391. <li><a class="reference internal" href="#module-alarmdecoder.decoder"><tt class="docutils literal"><span class="pre">alarmdecoder</span></tt> Module</a></li>
  1392. <li><a class="reference internal" href="#module-alarmdecoder.devices"><tt class="docutils literal"><span class="pre">devices</span></tt> Module</a></li>
  1393. <li><a class="reference internal" href="#module-alarmdecoder.messages"><tt class="docutils literal"><span class="pre">messages</span></tt> Module</a></li>
  1394. <li><a class="reference internal" href="#module-alarmdecoder.zonetracking"><tt class="docutils literal"><span class="pre">zonetracking</span></tt> Module</a></li>
  1395. <li><a class="reference internal" href="#module-alarmdecoder.util"><tt class="docutils literal"><span class="pre">util</span></tt> Module</a></li>
  1396. <li><a class="reference internal" href="#module-alarmdecoder.panels"><tt class="docutils literal"><span class="pre">panels</span></tt> Module</a></li>
  1397. </ul>
  1398. </li>
  1399. </ul>
  1400. <h4>Previous topic</h4>
  1401. <p class="topless"><a href="index.html"
  1402. title="previous chapter">Welcome to alarmdecoder&#8217;s documentation!</a></p>
  1403. <h3>This Page</h3>
  1404. <ul class="this-page-menu">
  1405. <li><a href="_sources/alarmdecoder.txt"
  1406. rel="nofollow">Show Source</a></li>
  1407. </ul>
  1408. <div id="searchbox" style="display: none">
  1409. <h3>Quick search</h3>
  1410. <form class="search" action="search.html" method="get">
  1411. <input type="text" name="q" />
  1412. <input type="submit" value="Go" />
  1413. <input type="hidden" name="check_keywords" value="yes" />
  1414. <input type="hidden" name="area" value="default" />
  1415. </form>
  1416. <p class="searchtip" style="font-size: 90%">
  1417. Enter search terms or a module, class or function name.
  1418. </p>
  1419. </div>
  1420. <script type="text/javascript">$('#searchbox').show(0);</script>
  1421. </div>
  1422. </div>
  1423. <div class="clearer"></div>
  1424. </div>
  1425. <div class="related">
  1426. <h3>Navigation</h3>
  1427. <ul>
  1428. <li class="right" style="margin-right: 10px">
  1429. <a href="genindex.html" title="General Index"
  1430. >index</a></li>
  1431. <li class="right" >
  1432. <a href="py-modindex.html" title="Python Module Index"
  1433. >modules</a> |</li>
  1434. <li class="right" >
  1435. <a href="index.html" title="Welcome to alarmdecoder’s documentation!"
  1436. >previous</a> |</li>
  1437. <li><a href="index.html">alarmdecoder documentation</a> &raquo;</li>
  1438. </ul>
  1439. </div>
  1440. <div class="footer">
  1441. &copy; Copyright 2013, Nu Tech Software Solutions, Inc..
  1442. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2b1.
  1443. </div>
  1444. </body>
  1445. </html>