docs: def calculate(self, msg: array.array) -> array.array:
          """
          Get the checksum for a WSP message. There are three hashes possible:
          1) 4 Bit Checksum - For Switch Telegram (RORG=5 or 6 and STATUS = 0x20 or 0x30)
          2) 8 Bit Checksum: STATUS bit 2^7 = 0
          3) 8 Bit CRC: STATUS bit 2^7 = 1
  
          :param msg: the message without Preamble/SOF and EOF. Message starts with RORG and ends with CRC
          """
          try:
              if self.mode == self.ChecksumMode.auto:
                  if msg[0:4] == util.hex2bit("5") or msg[0:4] == util.hex2bit("6"):
                      # Switch telegram
                      return self.checksum4(msg)
  
                  status = msg[-16:-8]
                  if status[0]:
                      return self.crc8(msg[:-8])  # ignore trailing hash
                  else:
                      return self.checksum8(msg[:-8])  # ignore trailing hash
  
              elif self.mode == self.ChecksumMode.checksum4:
                  return self.checksum4(msg)
              elif self.mode == self.ChecksumMode.checksum8:
                  return self.checksum8(msg[:-8])
              elif self.mode == self.ChecksumMode.crc8:
                  return self.crc8(msg[:-8])
  
          except IndexError:
              return None