diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index fcdc7b7..c0f4361 100644 Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ diff --git a/docs/_build/doctrees/pyad2.doctree b/docs/_build/doctrees/pyad2.doctree index 833b99b..8114e42 100644 Binary files a/docs/_build/doctrees/pyad2.doctree and b/docs/_build/doctrees/pyad2.doctree differ diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html index 3ce87ef..8a40aff 100644 --- a/docs/_build/html/genindex.html +++ b/docs/_build/html/genindex.html @@ -66,7 +66,9 @@ | S | T | U + | V | W + | X | Z @@ -74,6 +76,10 @@ - +
+
ac_power (pyad2.messages.Message attribute) +
+ +
AD2 (class in pyad2.ad2)
@@ -81,8 +87,6 @@
AD2Factory (class in pyad2.ad2)
-
AD2Factory.DetectThread (class in pyad2.ad2)
@@ -91,6 +95,28 @@
add() (pyad2.event.event.EventHandler method)
+
+ +
address (pyad2.messages.ExpanderMessage attribute) +
+ + +
alarm_event_occurred (pyad2.messages.Message attribute) +
+ + +
alarm_sounding (pyad2.messages.Message attribute) +
+ + +
armed_away (pyad2.messages.Message attribute) +
+ + +
armed_home (pyad2.messages.Message attribute) +
+
@@ -98,16 +124,28 @@
+
backlight_on (pyad2.messages.Message attribute) +
+ +
BaseMessage (class in pyad2.messages)
-
BATTERY_TIMEOUT (pyad2.ad2.AD2 attribute) +
battery (pyad2.messages.RFMessage attribute) +
+ + +
battery_low (pyad2.messages.Message attribute)
+
BATTERY_TIMEOUT (pyad2.ad2.AD2 attribute) +
+ +
BAUDRATE (pyad2.devices.SerialDevice attribute)
@@ -117,6 +155,14 @@
+ +
beeps (pyad2.messages.Message attribute) +
+ + +
bitfield (pyad2.messages.Message attribute) +
+
@@ -124,20 +170,32 @@
+
channel (pyad2.messages.ExpanderMessage attribute) +
+ +
CHECK (pyad2.zonetracking.Zone attribute)
-
CLEAR (pyad2.zonetracking.Zone attribute) +
check_zone (pyad2.messages.Message attribute)
-
clear_zone() (pyad2.ad2.AD2 method) +
chime_on (pyad2.messages.Message attribute) +
+ + +
CLEAR (pyad2.zonetracking.Zone attribute)
+
clear_zone() (pyad2.ad2.AD2 method) +
+ +
close() (pyad2.ad2.AD2 method)
@@ -171,6 +229,10 @@
create() (pyad2.ad2.AD2Factory class method)
+ +
cursor_location (pyad2.messages.Message attribute) +
+
@@ -202,16 +264,28 @@ - +
+
entry_delay_off (pyad2.messages.Message attribute) +
+ +
Event (class in pyad2.event.event)
-
EventHandler (class in pyad2.event.event) +
event_data (pyad2.messages.LRRMessage attribute) +
+ + +
event_type (pyad2.messages.LRRMessage attribute)
+
EventHandler (class in pyad2.event.event) +
+ +
ExpanderMessage (class in pyad2.messages)
@@ -249,8 +323,6 @@
fault_zone() (pyad2.ad2.AD2 method)
-
find_all() (pyad2.ad2.AD2Factory class method)
@@ -265,11 +337,17 @@
+
fire() (pyad2.event.event.EventHandler method)
+
fire_alarm (pyad2.messages.Message attribute) +
+ +
FIRE_TIMEOUT (pyad2.ad2.AD2 attribute)
@@ -348,6 +426,12 @@ +
+
loop (pyad2.messages.RFMessage attribute) +
+ +
+
LRRMessage (class in pyad2.messages)
@@ -358,6 +442,12 @@ + +
+
mask (pyad2.messages.Message attribute) +
+ +
+
Message (class in pyad2.messages)
@@ -371,6 +461,12 @@
NoDeviceError
+
+ +
numeric_code (pyad2.messages.Message attribute) +
+
@@ -524,6 +620,22 @@ + -
+
panel_data (pyad2.messages.Message attribute) +
+ + +
partition (pyad2.messages.LRRMessage attribute) +
+ + +
perimeter_only (pyad2.messages.Message attribute) +
+ + +
programming_mode (pyad2.messages.Message attribute) +
+ +
pyad2.ad2 (module)
@@ -531,6 +643,8 @@
pyad2.devices (module)
+
pyad2.event (module)
@@ -539,8 +653,6 @@
pyad2.event.event (module)
-
pyad2.messages (module)
@@ -564,6 +676,10 @@
+
raw (pyad2.messages.BaseMessage attribute) +
+ +
read() (pyad2.devices.SerialDevice method)
@@ -596,12 +712,16 @@ -
reboot() (pyad2.ad2.AD2 method) +
ready (pyad2.messages.Message attribute)
+
reboot() (pyad2.ad2.AD2 method) +
+ +
RELAY (pyad2.messages.ExpanderMessage attribute)
@@ -641,6 +761,12 @@
serial_number (pyad2.devices.USBDevice attribute)
+
+ +
(pyad2.messages.RFMessage attribute) +
+ +
SerialDevice (class in pyad2.devices)
@@ -717,6 +843,10 @@
stop_reader() (pyad2.devices.Device method)
+ +
supervision (pyad2.messages.RFMessage attribute) +
+
@@ -724,9 +854,19 @@ +
+
text (pyad2.messages.Message attribute) +
+ +
TimeoutError
+
+ +
type (pyad2.messages.ExpanderMessage attribute) +
+
@@ -750,6 +890,22 @@
+

V

+ + +
+ +
value (pyad2.messages.ExpanderMessage attribute) +
+ +
+ +
(pyad2.messages.RFMessage attribute) +
+ +
+
+

W

@@ -770,6 +926,16 @@
+

X

+ + +
+ +
x (pyad2.messages.RFMessage attribute) +
+ +
+

Z

@@ -379,7 +377,16 @@
send(data)[source]
-
+

Sends data to the AD2 device.

+
@@ -784,6 +950,10 @@
+
zone_bypassed (pyad2.messages.Message attribute) +
+ +
Zonetracker (class in pyad2.zonetracking)
diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv index 993a0ca..9dcc5a5 100644 Binary files a/docs/_build/html/objects.inv and b/docs/_build/html/objects.inv differ diff --git a/docs/_build/html/pyad2.html b/docs/_build/html/pyad2.html index 2eb609c..d10174d 100644 --- a/docs/_build/html/pyad2.html +++ b/docs/_build/html/pyad2.html @@ -360,8 +360,6 @@
Parameters:
  • baudrate (int) – The baudrate used for the device.
  • -
  • interface (varies depends on device type.. FIXME) – The interface used for the device.
  • -
  • index (int) – Interface index.. can probably remove. FIXME
  • no_reader_thread (bool) – Specifies whether or not the automatic reader thread should be started or not
+++ + + + +
Parameters:data (str) – The data to send.
+
@@ -1166,6 +1173,12 @@ Serial to IP interface.

class pyad2.messages.BaseMessage[source]

Bases: object

Base class for messages.

+
+
+raw = None
+

The raw message text

+
+
@@ -1173,6 +1186,138 @@ Serial to IP interface.

class pyad2.messages.Message(data=None)[source]

Bases: pyad2.messages.BaseMessage

Represents a message from the alarm panel.

+
+
+ready = False
+

Indicates whether or not the panel is in a ready state

+
+ +
+
+armed_away = False
+

Indicates whether or not the panel is armed away

+
+ +
+
+armed_home = False
+

Indicates whether or not the panel is armed home

+
+ +
+
+backlight_on = False
+

Indicates whether or not the keypad backlight is on

+
+ +
+
+programming_mode = False
+

Indicates whether or not we’re in programming mode

+
+ +
+
+beeps = -1
+

Number of beeps associated with a message

+
+ +
+
+zone_bypassed = False
+

Indicates whether or not a zone is bypassed

+
+ +
+
+ac_power = False
+

Indicates whether or not the panel is on AC power

+
+ +
+
+chime_on = False
+

Indicates whether or not the chime is enabled

+
+ +
+
+alarm_event_occurred = False
+

Indicates whether or not an alarm event has occurred

+
+ +
+
+alarm_sounding = False
+

Indicates whether or not an alarm is sounding

+
+ +
+
+battery_low = False
+

Indicates whether or not there is a low battery

+
+ +
+
+entry_delay_off = False
+

Indicates whether or not the entry delay is enabled

+
+ +
+
+fire_alarm = False
+

Indicates whether or not a fire alarm is sounding

+
+ +
+
+check_zone = False
+

Indicates whether or not there are zones that require attention.

+
+ +
+
+perimeter_only = False
+

Indicates whether or not the perimeter is armed

+
+ +
+
+numeric_code = None
+

The numeric code associated with the message

+
+ +
+
+text = None
+

The human-readable text to be displayed on the panel LCD

+
+ +
+
+cursor_location = -1
+

Current cursor location on the keypad

+
+ +
+
+mask = None
+

Address mask this message is intended for

+
+ +
+
+bitfield = None
+

The bitfield associated with this message

+
+ +
+
+panel_data = None
+

The panel data field associated with this message

+
+
@@ -1192,6 +1337,30 @@ Serial to IP interface.

Flag indicating that the expander message relates to a Relay Expander.

+
+
+type = None
+

Expander message type: ExpanderMessage.ZONE or ExpanderMessage.RELAY

+
+ +
+
+address = -1
+

Address of expander

+
+ +
+
+channel = -1
+

Channel on the expander

+
+ +
+
+value = -1
+

Value associated with the message

+
+
@@ -1199,6 +1368,41 @@ Serial to IP interface.

class pyad2.messages.RFMessage(data=None)[source]

Bases: pyad2.messages.BaseMessage

Represents a message from an RF receiver.

+
+
+x = 3
+
+ +
+
+serial_number = None
+

Serial number of the RF device

+
+ +
+
+value = -1
+

Value associated with this message

+
+ +
+
+battery = False
+

Battery low indication

+
+ +
+
+supervision = False
+

Supervision required indication

+
+ +
+
+loop = [False, False, False, False]
+

Loop indicators

+
+
@@ -1206,6 +1410,24 @@ Serial to IP interface.

class pyad2.messages.LRRMessage(data=None)[source]

Bases: pyad2.messages.BaseMessage

Represent a message from a Long Range Radio.

+
+
+event_data = None
+

Data associated with the LRR message. Usually user ID or zone.

+
+ +
+
+partition = -1
+

The partition that this message applies to

+
+ +
+
+event_type = None
+

The type of the event that occurred

+
+
diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js index 9ac06d8..525e3c1 100644 --- a/docs/_build/html/searchindex.js +++ b/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({envversion:42,terms:{event:[0,1,3],represent:3,all:[3,2],socketdevic:3,func:2,when:3,sent:3,disarm:3,ssl_kei:3,through:3,on_boot:3,stage_don:3,simulate_wire_problem:3,vari:3,paramet:3,current:3,baudrat:3,locat:3,zone:3,on_disarm:3,configur:3,fault_zon:3,send:3,should:3,on_attach:3,add:2,board:3,bypass:3,x03:3,on_read:3,x01:3,match:3,x04:3,sourc:[3,2],"return":3,around:3,clear_zon:3,format:3,handl:3,on_messag:3,stop:3,util:[0,1],ssl:3,on_bypass:3,zonetrack:[0,1],progress:3,report:3,detach:3,like:2,serialdevic:3,ad2:[0,1],name:3,level:3,rfx:3,list:3,upload:3,authent:3,factori:3,"try":3,"default":3,expand:3,stage_wait:3,updat:3,timeout:3,contain:3,found:3,expandermessag:3,page:0,certif:3,set:3,nodeviceerror:3,on_open:3,creation:3,request:3,on_pan:3,finish:3,"static":3,connect:3,fire_timeout:3,close:3,process:3,read_lin:3,arm:3,stop_read:3,ad2factori:3,pyseri:3,index:[0,3],statu:3,wire:3,power:3,clean:3,emul:3,pattern:3,ad2seri:3,reboot:3,content:0,pyftdi:3,written:3,earg:2,between:3,"new":2,method:3,localhost:3,can:[3,2],ser2sock:3,shut:3,full:3,run:3,timeouterror:3,kei:3,detached_ev:3,gener:3,usbdevic:3,lrr:3,on_clos:3,base:[3,2],ssl_certif:3,on_config_receiv:3,depend:3,"byte":3,on_detach:3,panel:[0,1],search:[0,3],actual:3,expos:3,thread:3,fault:3,fixm:3,readthread:3,simul:3,stage_start:3,prior:3,get_config:3,on_rfx_messag:3,fals:3,find_al:3,ad2usb:3,first:3,oper:2,revert:3,rang:3,via:3,attached_ev:3,modul:[0,1],"float":3,number:3,automat:3,system:3,down:3,filenam:3,alreadi:3,"long":3,famili:3,path:3,batteri:3,on_writ:3,open:3,on_power_chang:3,identif:3,differ:3,from:3,usb:3,messag:[0,1],commun:3,detectthread:3,support:3,devic:[0,1],on_relay_chang:3,been:3,get_devic:3,trigger:3,call:[3,2],low:3,interfac:3,type:3,start:3,"function":[3,2],wrapper:3,no_reader_thread:3,classmethod:3,stage_load:3,fire:[3,2],handler:2,relat:3,specifi:3,stage_boot:3,rfmessag:3,provid:3,flag:3,radio:3,relai:3,x02:3,obj:2,line:3,on_fir:3,cach:3,present:3,must:2,high:3,none:[3,2],sender:2,retriev:3,describ:3,on_restor:3,restor:3,whether:3,remov:[3,2],purg:3,on_alarm:3,dev:3,charact:3,defin:2,"while":3,stage_upload:3,str:3,entri:3,vendor:3,alarm:3,aliv:3,creat:3,"int":3,well:3,save_config:3,reader:3,templat:3,repres:3,on_zone_restor:3,packag:[0,1],on_fault:3,itself:2,exist:2,expir:3,ftdi_vendor_id:3,our:3,read_timeout:3,on_zone_fault:3,ftdi_product_id:3,attach:3,string:3,parent:3,battery_timeout:3,serial_numb:3,author:3,receiv:3,anoth:3,belong:3,boot:3,invalid:3,port:3,write:3,also:2,client:3,bool:3,which:3,tupl:3,instead:2,you:2,probabl:3,panic:3,singl:3,purge_buff:3,status:3,product:3,commerror:3,recogn:3,firmwar:3,callback:3,buffer:3,expans:3,object:[3,2],ftdi:3,befor:3,detect:3,track:3,basemessag:3,on_arm:3,eventhandl:2,data:3,"class":[3,2],serial:3,subpackag:[0,1],read:3,doc:2,clear:3,descript:3,except:3,rais:3,ssl_ca:3,issu:3,lrrmessag:3,"switch":3,is_reader_al:3,on_lrr_messag:3,error:3,progress_callback:3,check:3,invalidmessageerror:3,on_low_batteri:3},objtypes:{"0":"py:module","1":"py:attribute","2":"py:method","3":"py:class","4":"py:staticmethod","5":"py:classmethod","6":"py:exception"},objnames:{"0":["py","module","Python module"],"1":["py","attribute","Python attribute"],"2":["py","method","Python method"],"3":["py","class","Python class"],"4":["py","staticmethod","Python static method"],"5":["py","classmethod","Python class method"],"6":["py","exception","Python exception"]},filenames:["index","modules","pyad2.event","pyad2"],titles:["Welcome to pyad2’s documentation!","pyad2","event Package","pyad2 Package"],objects:{"pyad2.messages":{Message:[3,3,1,""],BaseMessage:[3,3,1,""],RFMessage:[3,3,1,""],ExpanderMessage:[3,3,1,""],LRRMessage:[3,3,1,""]},"pyad2.devices.Device.ReadThread":{READ_TIMEOUT:[3,1,1,""],run:[3,2,1,""],stop:[3,2,1,""]},"pyad2.util":{CommError:[3,6,1,""],Firmware:[3,3,1,""],TimeoutError:[3,6,1,""],NoDeviceError:[3,6,1,""],InvalidMessageError:[3,6,1,""]},"pyad2.event":{event:[2,0,1,""]},"pyad2.ad2.AD2Factory":{on_attached:[3,1,1,""],get_device:[3,2,1,""],DetectThread:[3,3,1,""],create:[3,5,1,""],stop:[3,2,1,""],devices:[3,5,1,""],on_detached:[3,1,1,""],start:[3,2,1,""],find_all:[3,5,1,""],close:[3,2,1,""]},"pyad2.devices.SerialDevice":{write:[3,2,1,""],BAUDRATE:[3,1,1,""],read:[3,2,1,""],read_line:[3,2,1,""],find_all:[3,4,1,""],"interface":[3,1,1,""],close:[3,2,1,""],open:[3,2,1,""]},"pyad2.messages.ExpanderMessage":{ZONE:[3,1,1,""],RELAY:[3,1,1,""]},pyad2:{ad2:[3,0,1,""],zonetracking:[3,0,1,""],messages:[3,0,1,""],devices:[3,0,1,""],util:[3,0,1,""],panels:[3,0,1,""],event:[2,0,1,""]},"pyad2.ad2.AD2Factory.DetectThread":{stop:[3,2,1,""],run:[3,2,1,""]},"pyad2.zonetracking.Zonetracker":{on_restore:[3,1,1,""],EXPIRE:[3,1,1,""],on_fault:[3,1,1,""],update:[3,2,1,""]},"pyad2.devices":{Device:[3,3,1,""],SocketDevice:[3,3,1,""],USBDevice:[3,3,1,""],SerialDevice:[3,3,1,""]},"pyad2.zonetracking.Zone":{STATUS:[3,1,1,""],FAULT:[3,1,1,""],CLEAR:[3,1,1,""],CHECK:[3,1,1,""]},"pyad2.ad2":{AD2:[3,3,1,""],AD2Factory:[3,3,1,""]},"pyad2.devices.SocketDevice":{ssl_key:[3,1,1,""],ssl_certificate:[3,1,1,""],read:[3,2,1,""],read_line:[3,2,1,""],ssl_ca:[3,1,1,""],write:[3,2,1,""],ssl:[3,1,1,""],"interface":[3,1,1,""],close:[3,2,1,""],open:[3,2,1,""]},"pyad2.devices.USBDevice":{read_line:[3,2,1,""],BAUDRATE:[3,1,1,""],description:[3,1,1,""],read:[3,2,1,""],write:[3,2,1,""],find_all:[3,4,1,""],FTDI_VENDOR_ID:[3,1,1,""],serial_number:[3,1,1,""],"interface":[3,1,1,""],close:[3,2,1,""],FTDI_PRODUCT_ID:[3,1,1,""],open:[3,2,1,""]},"pyad2.util.Firmware":{STAGE_LOAD:[3,1,1,""],upload:[3,4,1,""],STAGE_WAITING:[3,1,1,""],STAGE_START:[3,1,1,""],STAGE_UPLOADING:[3,1,1,""],STAGE_BOOT:[3,1,1,""],STAGE_DONE:[3,1,1,""]},"pyad2.ad2.AD2":{on_rfx_message:[3,1,1,""],fault_zone:[3,2,1,""],on_open:[3,1,1,""],save_config:[3,2,1,""],on_relay_changed:[3,1,1,""],on_boot:[3,1,1,""],close:[3,2,1,""],open:[3,2,1,""],id:[3,1,1,""],on_power_changed:[3,1,1,""],BATTERY_TIMEOUT:[3,1,1,""],on_message:[3,1,1,""],send:[3,2,1,""],reboot:[3,2,1,""],get_config:[3,2,1,""],on_zone_restore:[3,1,1,""],on_disarm:[3,1,1,""],on_fire:[3,1,1,""],on_write:[3,1,1,""],on_read:[3,1,1,""],on_lrr_message:[3,1,1,""],clear_zone:[3,2,1,""],on_zone_fault:[3,1,1,""],on_config_received:[3,1,1,""],on_close:[3,1,1,""],on_bypass:[3,1,1,""],on_low_battery:[3,1,1,""],on_arm:[3,1,1,""],F1:[3,1,1,""],F2:[3,1,1,""],F3:[3,1,1,""],F4:[3,1,1,""],on_alarm:[3,1,1,""],on_panic:[3,1,1,""],FIRE_TIMEOUT:[3,1,1,""]},"pyad2.zonetracking":{Zonetracker:[3,3,1,""],Zone:[3,3,1,""]},"pyad2.event.event.EventHandler":{fire:[2,2,1,""],add:[2,2,1,""],remove:[2,2,1,""]},"pyad2.event.event":{EventHandler:[2,3,1,""],Event:[2,3,1,""]},"pyad2.devices.Device":{on_open:[3,1,1,""],on_write:[3,1,1,""],ReadThread:[3,3,1,""],on_close:[3,1,1,""],on_read:[3,1,1,""],close:[3,2,1,""],stop_reader:[3,2,1,""],is_reader_alive:[3,2,1,""],id:[3,1,1,""]}},titleterms:{subpackag:3,ad2:3,welcom:0,pyad2:[0,1,3],modul:[3,2],devic:3,messag:3,util:3,packag:[3,2],zonetrack:3,indic:0,tabl:0,document:0,event:2,panel:3}}) \ No newline at end of file +Search.setIndex({envversion:42,terms:{represent:3,all:[3,2],code:3,on_boot:3,stage_don:3,backlight:3,depend:[],zone:3,readabl:3,send:3,program:3,x03:3,x02:3,x01:3,sent:3,x04:3,sourc:[3,2],string:3,clear_zon:3,fals:3,on_messag:3,perimeter_onli:3,util:[],lrr:3,level:3,list:3,upload:3,"try":3,emul:3,expandermessag:3,port:3,index:0,ad2seri:3,current:3,"new":2,method:3,ser2sock:3,full:3,timeouterror:3,detached_ev:3,gener:3,usbdevic:3,entry_delay_off:3,on_config_receiv:3,address:3,path:3,valu:3,fire_alarm:3,search:[0,3],sender:2,on_clos:3,prior:3,invalidmessageerror:3,via:3,appli:3,modul:[],zonetrack:[],filenam:3,famili:3,from:3,describ:3,commun:3,is_reader_al:3,handler:2,call:[3,2],type:3,relat:3,stage_boot:3,flag:3,relai:3,actual:3,cach:3,serialdevic:3,must:2,none:[3,2],retriev:3,on_restor:3,restor:3,dev:3,can:2,aliv:3,backlight_on:3,process:3,templat:3,high:3,cursor_loc:3,serial:3,occur:3,delai:3,progress_callback:3,anoth:3,simulate_wire_problem:3,write:3,purg:3,instead:2,panic:3,updat:3,product:3,recogn:3,ftdi:3,befor:3,attent:3,data:3,classmethod:3,ssl_ca:3,issu:3,callback:3,"switch":3,socketdevic:3,disarm:3,through:3,vari:[],paramet:3,raw:3,usb:3,bypass:3,on_read:3,"return":3,handl:3,on_bypass:3,detach:3,name:3,revert:3,on_pan:3,authent:3,stage_wait:3,mode:3,timeout:3,found:3,rfx:3,nodeviceerror:3,"static":3,connect:3,our:3,read_lin:3,event:[],reboot:3,content:0,reader:3,factori:3,shut:3,written:3,fixm:[],base:[3,2],"byte":3,armed_hom:3,on_detach:3,thread:3,readthread:3,get_config:3,on_rfx_messag:3,find_al:3,ad2usb:3,first:3,oper:2,rang:3,attached_ev:3,number:3,alreadi:3,messag:[],on_writ:3,open:3,on_power_chang:3,differ:3,associ:3,system:3,wrapper:3,attach:3,on_open:3,battery_low:3,specifi:3,rfmessag:3,on_fir:3,provid:3,remov:[3,2],charact:3,str:3,save_config:3,bitfield:3,packag:[],on_fault:3,expir:3,programming_mod:3,also:2,which:3,event_data:3,channel:3,thi:3,supervis:3,buffer:3,object:[3,2],detect:3,basemessag:3,"class":[3,2],armed_awai:3,doc:2,clear:3,request:3,on_low_batteri:3,clean:3,text:3,ssl_kei:3,radio:3,locat:3,configur:3,fault_zon:3,should:3,serial_numb:3,stop:3,ssl:3,report:3,requir:3,enabl:3,earg:2,whether:3,partit:3,contain:3,alarm_event_occur:3,certif:3,set:3,keypad:3,ac_pow:3,on_alarm:3,perimet:3,close:3,arm:3,stop_read:3,pyseri:3,statu:3,wire:3,parent:3,pattern:3,state:3,between:3,progress:3,awai:3,kei:3,numer:3,fault:3,batteri:3,on_attach:3,detectthread:3,devic:[],been:3,beep:3,get_devic:3,trigger:3,no_reader_thread:3,fire:[3,2],commerror:3,chime_on:3,func:2,present:3,sound:3,check_zon:3,cursor:3,defin:2,"while":3,stage_upload:3,error:3,loop:3,readi:3,itself:2,ftdi_vendor_id:3,on_zone_fault:3,alarm_sound:3,panel_data:3,author:3,receiv:3,belong:3,status:3,finish:3,ad2factori:3,expans:3,rais:3,user:3,expand:3,subpackag:[],entri:3,well:3,client:3,zone_bypass:3,usual:3,when:3,human:3,baudrat:3,expos:3,on_disarm:3,except:3,identif:3,add:2,board:3,match:3,vendor:3,around:3,format:3,read:3,numeric_cod:3,lcd:3,ad2:[],like:2,singl:3,page:0,creation:3,fire_timeout:3,home:3,pyftdi:3,localhost:3,run:3,power:3,event_typ:3,stage_load:3,ssl_certif:3,panel:[],obj:2,simul:3,stage_start:3,"float":3,automat:3,down:3,chime:3,support:3,on_relay_chang:3,"long":3,start:3,interfac:3,low:3,"function":[3,2],tupl:3,eventhandl:2,line:3,"default":3,displai:3,purge_buff:3,alarm:3,creat:3,"int":3,mask:3,repres:3,on_zone_restor:3,exist:2,read_timeout:3,ftdi_product_id:3,check:3,probabl:[],battery_timeout:3,boot:3,invalid:3,field:3,bool:3,you:2,intend:3,firmwar:3,track:3,on_arm:3,descript:3,lrrmessag:3,on_lrr_messag:3},objtypes:{"0":"py:module","1":"py:attribute","2":"py:method","3":"py:class","4":"py:staticmethod","5":"py:classmethod","6":"py:exception"},objnames:{"0":["py","module","Python module"],"1":["py","attribute","Python attribute"],"2":["py","method","Python method"],"3":["py","class","Python class"],"4":["py","staticmethod","Python static method"],"5":["py","classmethod","Python class method"],"6":["py","exception","Python exception"]},filenames:["index","modules","pyad2.event","pyad2"],titles:["Welcome to pyad2’s documentation!","pyad2","event Package","pyad2 Package"],objects:{"pyad2.messages":{Message:[3,3,1,""],BaseMessage:[3,3,1,""],RFMessage:[3,3,1,""],ExpanderMessage:[3,3,1,""],LRRMessage:[3,3,1,""]},"pyad2.messages.LRRMessage":{partition:[3,1,1,""],event_type:[3,1,1,""],event_data:[3,1,1,""]},"pyad2.util":{CommError:[3,6,1,""],Firmware:[3,3,1,""],TimeoutError:[3,6,1,""],NoDeviceError:[3,6,1,""],InvalidMessageError:[3,6,1,""]},pyad2:{ad2:[3,0,1,""],zonetracking:[3,0,1,""],messages:[3,0,1,""],devices:[3,0,1,""],util:[3,0,1,""],panels:[3,0,1,""],event:[2,0,1,""]},"pyad2.devices":{Device:[3,3,1,""],SocketDevice:[3,3,1,""],USBDevice:[3,3,1,""],SerialDevice:[3,3,1,""]},"pyad2.event.event.EventHandler":{fire:[2,2,1,""],add:[2,2,1,""],remove:[2,2,1,""]},"pyad2.devices.USBDevice":{read_line:[3,2,1,""],BAUDRATE:[3,1,1,""],description:[3,1,1,""],read:[3,2,1,""],write:[3,2,1,""],find_all:[3,4,1,""],FTDI_VENDOR_ID:[3,1,1,""],serial_number:[3,1,1,""],"interface":[3,1,1,""],close:[3,2,1,""],FTDI_PRODUCT_ID:[3,1,1,""],open:[3,2,1,""]},"pyad2.event.event":{EventHandler:[2,3,1,""],Event:[2,3,1,""]},"pyad2.devices.Device":{on_read:[3,1,1,""],on_open:[3,1,1,""],ReadThread:[3,3,1,""],on_close:[3,1,1,""],on_write:[3,1,1,""],close:[3,2,1,""],stop_reader:[3,2,1,""],is_reader_alive:[3,2,1,""],id:[3,1,1,""]},"pyad2.zonetracking":{Zonetracker:[3,3,1,""],Zone:[3,3,1,""]},"pyad2.zonetracking.Zonetracker":{on_restore:[3,1,1,""],EXPIRE:[3,1,1,""],on_fault:[3,1,1,""],update:[3,2,1,""]},"pyad2.zonetracking.Zone":{STATUS:[3,1,1,""],FAULT:[3,1,1,""],CLEAR:[3,1,1,""],CHECK:[3,1,1,""]},"pyad2.util.Firmware":{STAGE_LOAD:[3,1,1,""],upload:[3,4,1,""],STAGE_WAITING:[3,1,1,""],STAGE_START:[3,1,1,""],STAGE_UPLOADING:[3,1,1,""],STAGE_BOOT:[3,1,1,""],STAGE_DONE:[3,1,1,""]},"pyad2.messages.BaseMessage":{raw:[3,1,1,""]},"pyad2.event":{event:[2,0,1,""]},"pyad2.ad2.AD2Factory":{on_attached:[3,1,1,""],get_device:[3,2,1,""],DetectThread:[3,3,1,""],create:[3,5,1,""],stop:[3,2,1,""],devices:[3,5,1,""],on_detached:[3,1,1,""],start:[3,2,1,""],find_all:[3,5,1,""],close:[3,2,1,""]},"pyad2.devices.SerialDevice":{read_line:[3,2,1,""],BAUDRATE:[3,1,1,""],read:[3,2,1,""],write:[3,2,1,""],find_all:[3,4,1,""],"interface":[3,1,1,""],close:[3,2,1,""],open:[3,2,1,""]},"pyad2.messages.ExpanderMessage":{RELAY:[3,1,1,""],ZONE:[3,1,1,""],value:[3,1,1,""],address:[3,1,1,""],type:[3,1,1,""],channel:[3,1,1,""]},"pyad2.devices.SocketDevice":{ssl_key:[3,1,1,""],ssl_certificate:[3,1,1,""],read:[3,2,1,""],read_line:[3,2,1,""],ssl_ca:[3,1,1,""],write:[3,2,1,""],ssl:[3,1,1,""],"interface":[3,1,1,""],close:[3,2,1,""],open:[3,2,1,""]},"pyad2.ad2.AD2Factory.DetectThread":{stop:[3,2,1,""],run:[3,2,1,""]},"pyad2.devices.Device.ReadThread":{READ_TIMEOUT:[3,1,1,""],run:[3,2,1,""],stop:[3,2,1,""]},"pyad2.messages.Message":{backlight_on:[3,1,1,""],alarm_event_occurred:[3,1,1,""],programming_mode:[3,1,1,""],text:[3,1,1,""],bitfield:[3,1,1,""],armed_home:[3,1,1,""],alarm_sounding:[3,1,1,""],ready:[3,1,1,""],zone_bypassed:[3,1,1,""],panel_data:[3,1,1,""],check_zone:[3,1,1,""],numeric_code:[3,1,1,""],battery_low:[3,1,1,""],chime_on:[3,1,1,""],entry_delay_off:[3,1,1,""],perimeter_only:[3,1,1,""],fire_alarm:[3,1,1,""],ac_power:[3,1,1,""],beeps:[3,1,1,""],mask:[3,1,1,""],armed_away:[3,1,1,""],cursor_location:[3,1,1,""]},"pyad2.ad2":{AD2:[3,3,1,""],AD2Factory:[3,3,1,""]},"pyad2.ad2.AD2":{on_rfx_message:[3,1,1,""],fault_zone:[3,2,1,""],on_open:[3,1,1,""],save_config:[3,2,1,""],on_relay_changed:[3,1,1,""],on_boot:[3,1,1,""],close:[3,2,1,""],open:[3,2,1,""],id:[3,1,1,""],on_power_changed:[3,1,1,""],BATTERY_TIMEOUT:[3,1,1,""],on_message:[3,1,1,""],send:[3,2,1,""],reboot:[3,2,1,""],get_config:[3,2,1,""],on_zone_restore:[3,1,1,""],on_disarm:[3,1,1,""],on_fire:[3,1,1,""],on_write:[3,1,1,""],on_read:[3,1,1,""],on_lrr_message:[3,1,1,""],clear_zone:[3,2,1,""],on_zone_fault:[3,1,1,""],on_config_received:[3,1,1,""],on_close:[3,1,1,""],on_bypass:[3,1,1,""],on_low_battery:[3,1,1,""],on_arm:[3,1,1,""],F1:[3,1,1,""],F2:[3,1,1,""],F3:[3,1,1,""],F4:[3,1,1,""],on_alarm:[3,1,1,""],on_panic:[3,1,1,""],FIRE_TIMEOUT:[3,1,1,""]},"pyad2.messages.RFMessage":{battery:[3,1,1,""],supervision:[3,1,1,""],value:[3,1,1,""],serial_number:[3,1,1,""],x:[3,1,1,""],loop:[3,1,1,""]}},titleterms:{subpackag:3,ad2:3,welcom:0,pyad2:[0,1,3],modul:[3,2],devic:3,messag:3,util:3,packag:[3,2],zonetrack:3,indic:0,tabl:0,document:0,event:2,panel:3}}) \ No newline at end of file diff --git a/pyad2/messages.py b/pyad2/messages.py index 124564d..708f430 100644 --- a/pyad2/messages.py +++ b/pyad2/messages.py @@ -12,11 +12,15 @@ class BaseMessage(object): """ Base class for messages. """ + + raw = None + """The raw message text""" + def __init__(self): """ Constructor """ - self.raw = None + pass def __str__(self): """ @@ -29,6 +33,51 @@ class Message(BaseMessage): Represents a message from the alarm panel. """ + ready = False + """Indicates whether or not the panel is in a ready state""" + armed_away = False + """Indicates whether or not the panel is armed away""" + armed_home = False + """Indicates whether or not the panel is armed home""" + backlight_on = False + """Indicates whether or not the keypad backlight is on""" + programming_mode = False + """Indicates whether or not we're in programming mode""" + beeps = -1 + """Number of beeps associated with a message""" + zone_bypassed = False + """Indicates whether or not a zone is bypassed""" + ac_power = False + """Indicates whether or not the panel is on AC power""" + chime_on = False + """Indicates whether or not the chime is enabled""" + alarm_event_occurred = False + """Indicates whether or not an alarm event has occurred""" + alarm_sounding = False + """Indicates whether or not an alarm is sounding""" + battery_low = False + """Indicates whether or not there is a low battery""" + entry_delay_off = False + """Indicates whether or not the entry delay is enabled""" + fire_alarm = False + """Indicates whether or not a fire alarm is sounding""" + check_zone = False + """Indicates whether or not there are zones that require attention.""" + perimeter_only = False + """Indicates whether or not the perimeter is armed""" + numeric_code = None + """The numeric code associated with the message""" + text = None + """The human-readable text to be displayed on the panel LCD""" + cursor_location = -1 + """Current cursor location on the keypad""" + mask = None + """Address mask this message is intended for""" + bitfield = None + """The bitfield associated with this message""" + panel_data = None + """The panel data field associated with this message""" + def __init__(self, data=None): """ Constructor @@ -36,35 +85,19 @@ class Message(BaseMessage): :param data: Message data to parse. :type data: str """ - self.ready = False - self.armed_away = False - self.armed_home = False - self.backlight_on = False - self.programming_mode = False - self.beeps = -1 - self.zone_bypassed = False - self.ac_power = False - self.chime_on = False - self.alarm_event_occurred = False - self.alarm_sounding = False - self.battery_low = False - self.entry_delay_off = False - self.fire_alarm = False - self.check_zone = False - self.perimeter_only = False - self.numeric_code = "" - self.text = "" - self.cursor_location = -1 - self.data = "" - self.mask = "" - self.bitfield = "" - self.panel_data = "" + BaseMessage.__init__(self) self._regex = re.compile('("(?:[^"]|"")*"|[^,]*),("(?:[^"]|"")*"|[^,]*),("(?:[^"]|"")*"|[^,]*),("(?:[^"]|"")*"|[^,]*)') if data is not None: self._parse_message(data) + def __str__(self): + """ + String conversion operator. + """ + return self.raw + def _parse_message(self, data): """ Parse the message from the device. @@ -107,12 +140,6 @@ class Message(BaseMessage): if int(self.panel_data[19:21], 16) & 0x01 > 0: self.cursor_location = int(self.bitfield[21:23], 16) # Alpha character index that the cursor is on. - def __str__(self): - """ - String conversion operator. - """ - return self.raw - class ExpanderMessage(BaseMessage): """ Represents a message from a zone or relay expansion module. @@ -123,6 +150,16 @@ class ExpanderMessage(BaseMessage): RELAY = 1 """Flag indicating that the expander message relates to a Relay Expander.""" + + type = None + """Expander message type: ExpanderMessage.ZONE or ExpanderMessage.RELAY""" + address = -1 + """Address of expander""" + channel = -1 + """Channel on the expander""" + value = -1 + """Value associated with the message""" + def __init__(self, data=None): """ Constructor @@ -130,11 +167,7 @@ class ExpanderMessage(BaseMessage): :param data: The message data to parse. :type data: str """ - self.type = None - self.address = None - self.channel = None - self.value = None - self.raw = None + BaseMessage.__init__(self) if data is not None: self._parse_message(data) @@ -176,6 +209,17 @@ class RFMessage(BaseMessage): Represents a message from an RF receiver. """ + serial_number = None + """Serial number of the RF device""" + value = -1 + """Value associated with this message""" + battery = False + """Battery low indication""" + supervision = False + """Supervision required indication""" + loop = [False for x in range(4)] + """Loop indicators""" + def __init__(self, data=None): """ Constructor @@ -183,12 +227,7 @@ class RFMessage(BaseMessage): :param data: The message data to parse :type data: str """ - self.raw = None - self.serial_number = None - self.value = None - self.battery = None - self.supervision = None - self.loop = {} + BaseMessage.__init__(self) if data is not None: self._parse_message(data) @@ -218,7 +257,7 @@ class RFMessage(BaseMessage): # Bit 1 = unknown self.battery = is_bit_set(2) self.supervision = is_bit_set(3) - # Bit 8 = unknown + # Bit 4 = unknown self.loop[0] = is_bit_set(5) self.loop[1] = is_bit_set(6) self.loop[2] = is_bit_set(7) @@ -227,12 +266,18 @@ class RFMessage(BaseMessage): except ValueError: raise InvalidMessageError('Received invalid message: {0}'.format(data)) - class LRRMessage(BaseMessage): """ Represent a message from a Long Range Radio. """ + event_data = None + """Data associated with the LRR message. Usually user ID or zone.""" + partition = -1 + """The partition that this message applies to""" + event_type = None + """The type of the event that occurred""" + def __init__(self, data=None): """ Constructor @@ -240,10 +285,7 @@ class LRRMessage(BaseMessage): :param data: The message data to parse. :type data: str """ - self.raw = None - self.event_data = None - self.partition = None - self.event_type = None + BaseMessage.__init__(self) if data is not None: self._parse_message(data)