code: def check_flashing_need(self, execution_type, build_id, force):
          
          binary_file_name = AllocationContextList.get_build(build_id)
          if binary_file_name:
              if execution_type == 'hardware' and os.path.isfile(binary_file_name):
                  if not force:
                      #@todo: Make a better check for binary compatibility
                      extension_split = os.path.splitext(binary_file_name)
                      extension = extension_split[-1].lower()
                      if extension != '.bin' and extension != '.hex':
                          self.logger.debug("File ('%s') is not supported to flash, skip it" %(
                              build_id))
                          return False
                      return True
                  return True
              else:
                  raise ResourceInitError("Given binary %s does not exist" % build_id)
          else:
              raise ResourceInitError("Given binary %s does not exist" % build_id)
docs: Check if flashing of local device is required.
  
          :param execution_type: Should be 'hardware'
          :param build_id: Build id, usually file name
          :param force: Forceflash flag
          :return: Boolean