original_docstring:  MsgType=A7 - Panel Status Change 
docstring: MsgType=A7 - Panel Status Change
docstring_tokens: MsgType = A7 - Panel Status Change
code: def handle_msgtypeA7(self, data):
          """ MsgType=A7 - Panel Status Change """
          log.info("[handle_msgtypeA7] Panel Status Change " + self.toString(data))
  
          msgCnt = int(data[0])
          temp = int(data[1])  # don't know what this is (It is 0x00 in test messages so could be the higher 8 bits for msgCnt)
          log.debug("[handle_msgtypeA7]      A7 message contains {0} messages".format(msgCnt))
          for i in range(0, msgCnt):
              eventZone = int(data[2 + (2 * i)])
              logEvent  = int(data[3 + (2 * i)])
              eventType = int(logEvent & 0x7F)
              s = (pmLogEvent_t[self.pmLang][eventType] or "UNKNOWN") + " / " + (pmLogUser_t[self.pmLang][eventZone] or "UNKNOWN")
              alarmStatus = None
              if eventType in pmPanelAlarmType_t:
                  alarmStatus = pmPanelAlarmType_t[eventType]
              troubleStatus = None
              if eventType in pmPanelTroubleType_t:
                  troubleStatus = pmPanelTroubleType_t[eventType]
  
              PanelStatus["Panel Last Event"]     = s
              PanelStatus["Panel Alarm Status"]   = "None" if alarmStatus is None else alarmStatus
              PanelStatus["Panel Trouble Status"] = "None" if troubleStatus is None else troubleStatus
  
              log.info("[handle_msgtypeA7]         System message " + s + "  alarmStatus " + PanelStatus["Panel Alarm Status"] + "   troubleStatus " + PanelStatus["Panel Trouble Status"])
  
              # Update siren status
              noSiren = ((eventType == 0x0B) or (eventType == 0x0C)) and self.pmSilentPanic
  
              if (alarmStatus is not None) and (eventType != 0x04) and (not noSiren):
                  self.pmSirenActive = self.getTimeFunction()
                  log.debug("Alarm Active")
              if eventType == 0x1B and self.pmSirenActive is not None: # Cancel Alarm
                  self.pmSirenActive = None
                  log.debug("Alarm Cancelled")
              # INTERFACE Indicate whether siren active
              PanelStatus["Panel Siren Active"] = 'Yes' if self.pmSirenActive != None else 'No'
  
              log.debug("[handle_msgtypeA7]                self.pmSirenActive={0}   noSiren={1}   eventType={2}   self.pmSilentPanic={3}".format(self.pmSirenActive, noSiren, hex(eventType), self.pmSilentPanic) )
              
              if eventType == 0x60: # system restart
                  log.warning("handle_msgtypeA7:         Panel has been reset")
                  self.Start_Download()
                  self.sendResponseEvent ( 4 )   # push changes through to the host, the panel itself has been reset
  
          if self.pmSirenActive is not None:
              self.sendResponseEvent ( 3 )   # push changes through to the host to get it to update, alarm is active!!!!!!!!!
          else:
              self.sendResponseEvent ( 2 )
code_tokens: def handle_msgtypeA7 ( self , data ) : log . info ( "[handle_msgtypeA7] Panel Status Change " + self . toString ( data ) ) msgCnt = int ( data [ 0 ] ) temp = int ( data [ 1 ] ) log . debug ( "[handle_msgtypeA7]      A7 message contains {0} messages" . format ( msgCnt ) ) for i in range ( 0 , msgCnt ) : eventZone = int ( data [ 2 + ( 2 * i ) ] ) logEvent = int ( data [ 3 + ( 2 * i ) ] ) eventType = int ( logEvent & 0x7F ) s = ( pmLogEvent_t [ self . pmLang ] [ eventType ] or "UNKNOWN" ) + " / " + ( pmLogUser_t [ self . pmLang ] [ eventZone ] or "UNKNOWN" ) alarmStatus = None if eventType in pmPanelAlarmType_t : alarmStatus = pmPanelAlarmType_t [ eventType ] troubleStatus = None if eventType in pmPanelTroubleType_t : troubleStatus = pmPanelTroubleType_t [ eventType ] PanelStatus [ "Panel Last Event" ] = s PanelStatus [ "Panel Alarm Status" ] = "None" if alarmStatus is None else alarmStatus PanelStatus [ "Panel Trouble Status" ] = "None" if troubleStatus is None else troubleStatus log . info ( "[handle_msgtypeA7]         System message " + s + "  alarmStatus " + PanelStatus [ "Panel Alarm Status" ] + "   troubleStatus " + PanelStatus [ "Panel Trouble Status" ] ) noSiren = ( ( eventType == 0x0B ) or ( eventType == 0x0C ) ) and self . pmSilentPanic if ( alarmStatus is not None ) and ( eventType != 0x04 ) and ( not noSiren ) : self . pmSirenActive = self . getTimeFunction ( ) log . debug ( "Alarm Active" ) if eventType == 0x1B and self . pmSirenActive is not None : self . pmSirenActive = None log . debug ( "Alarm Cancelled" ) PanelStatus [ "Panel Siren Active" ] = 'Yes' if self . pmSirenActive != None else 'No' log . debug ( "[handle_msgtypeA7]                self.pmSirenActive={0}   noSiren={1}   eventType={2}   self.pmSilentPanic={3}" . format ( self . pmSirenActive , noSiren , hex ( eventType ) , self . pmSilentPanic ) ) if eventType == 0x60 : log . warning ( "handle_msgtypeA7:         Panel has been reset" ) self . Start_Download ( ) self . sendResponseEvent ( 4 ) if self . pmSirenActive is not None : self . sendResponseEvent ( 3 ) else : self . sendResponseEvent ( 2 )
short_docstring: MsgType=A7 - Panel Status Change
short_docstring_tokens: MsgType = A7 - Panel Status Change
comment: """ MsgType=A7 - Panel Status Change """$SEP$# don't know what this is (It is 0x00 in test messages so could be the higher 8 bits for msgCnt)$SEP$# Update siren status$SEP$# Cancel Alarm$SEP$# INTERFACE Indicate whether siren active$SEP$# system restart$SEP$# push changes through to the host, the panel itself has been reset$SEP$# push changes through to the host to get it to update, alarm is active!!!!!!!!!